From ced33a232f351faf0f37d413b4073d504f6b360f Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E8=AB=8F=E8=A8=AA=E5=AD=90?= Date: Wed, 22 May 2024 18:37:00 +0900 Subject: [PATCH] =?utf8?q?=E4=BD=BF=E3=81=84=E6=96=B9=E3=81=AE=E4=BF=AE?= =?utf8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + main.c | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bb0872..615b3f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * 1つ以上のファイルがダウンロードに失敗する場合、正しく状況を知らせる様に * 予行演習モード * `make release-freebsd`の修正 +* 使い方の修正 # 0.2.0 * ファイル名はパラメートルを付いたら、ファイル名は拡張子に diff --git a/main.c b/main.c index 4db1329..ea931f1 100644 --- a/main.c +++ b/main.c @@ -107,6 +107,10 @@ void dlsucmsg() { } } +void usage() { + printf("%s-%s\nusage: %s [-%s] [url ...]\n", sofname, version, sofname, avalopt); +} + void flags(int opt, int argc, char* argv[]) { switch (opt) { case 'n': @@ -123,7 +127,7 @@ void flags(int opt, int argc, char* argv[]) { break; default: err_flag = 1; - printf("usage: %s-%s [-%s] [url ...]\n", sofname, version, avalopt); + usage(); break; } } @@ -197,7 +201,7 @@ int downloader(CURL* curl, char* filename, const char* url) { int main(int argc, char* argv[]) { if (argc < 2) { - printf("usage: %s-%s [-%s] [url ...]\n", sofname, version, avalopt); + usage(); return 1; } -- 2.43.0