From: Ruediger Meier Date: Sun, 25 Jun 2017 12:49:47 +0000 (+0200) Subject: misc: consolidate all --help option descriptions X-Git-Tag: v2.31-rc1~257^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b30544549505019f5fc092c5d99fcb1cae1a44b1;p=thirdparty%2Futil-linux.git misc: consolidate all --help option descriptions Now we are always using the same text also for commands which had still hardcoded descriptions or where we can't use the standard print_usage_help_options macro. Signed-off-by: Ruediger Meier --- diff --git a/disk-utils/fsck.c b/disk-utils/fsck.c index 918103ac0c..3fe3959c19 100644 --- a/disk-utils/fsck.c +++ b/disk-utils/fsck.c @@ -1394,8 +1394,8 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -V explain what is being done\n"), out); fputs(USAGE_SEPARATOR, out); - fputs(_(" -?, --help display this help and exit\n"), out); - fputs(_(" --version output version information and exit\n"), out); + printf( " -?, --help %s\n", USAGE_OPTSTR_HELP); + printf( " --version %s\n", USAGE_OPTSTR_VERSION); fputs(USAGE_SEPARATOR, out); fputs(_("See the specific fsck.* commands for available fs-options."), out); fprintf(out, USAGE_MAN_TAIL("fsck(8)")); diff --git a/disk-utils/fsck.cramfs.c b/disk-utils/fsck.cramfs.c index 9fade86d22..4656852782 100644 --- a/disk-utils/fsck.cramfs.c +++ b/disk-utils/fsck.cramfs.c @@ -120,9 +120,9 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -b, --blocksize use this blocksize, defaults to page size\n"), out); fputs(_(" --extract[=] test uncompression, optionally extract into \n"), out); fputs(USAGE_SEPARATOR, out); - print_usage_help_options(16); - fputs(USAGE_SEPARATOR, out); + print_usage_help_options(26); + printf(USAGE_MAN_TAIL("fsck.cramfs(8)")); exit(FSCK_EX_OK); } diff --git a/disk-utils/mkfs.bfs.c b/disk-utils/mkfs.bfs.c index b19afa7cdf..fbf2887caf 100644 --- a/disk-utils/mkfs.bfs.c +++ b/disk-utils/mkfs.bfs.c @@ -84,9 +84,8 @@ static void __attribute__((__noreturn__)) usage(void) " -v, --verbose explain what is being done\n" " -c this option is silently ignored\n" " -l this option is silently ignored\n" - " -V, --version output version information and exit\n" - " -V as version must be only option\n" - " -h, --help display this help and exit\n\n")); + )); + print_usage_help_options(21); fprintf(out, USAGE_MAN_TAIL("mkfs.bfs(8)")); exit(EXIT_SUCCESS); diff --git a/disk-utils/mkfs.c b/disk-utils/mkfs.c index 25cc59d20d..f7b0c0a090 100644 --- a/disk-utils/mkfs.c +++ b/disk-utils/mkfs.c @@ -55,12 +55,9 @@ static void __attribute__((__noreturn__)) usage(void) fprintf(out, _(" number of blocks to be used on the device\n")); fprintf(out, _(" -V, --verbose explain what is being done;\n" " specifying -V more than once will cause a dry-run\n")); - fprintf(out, _(" -V, --version display version information and exit;\n" - " -V as --version must be the only option\n")); - fprintf(out, _(" -h, --help display this help text and exit\n")); + print_usage_help_options(20); fprintf(out, USAGE_MAN_TAIL("mkfs(8)")); - exit(EXIT_SUCCESS); } diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c index 73e5258ed3..593a61e03d 100644 --- a/disk-utils/mkswap.c +++ b/disk-utils/mkswap.c @@ -160,9 +160,10 @@ static void __attribute__((__noreturn__)) usage(void) " -L, --label LABEL specify label\n" " -v, --swapversion NUM specify swap-space version number\n" " -U, --uuid UUID specify the uuid to use\n" - " -V, --version output version information and exit\n" - " -h, --help display this help and exit\n\n")); + )); + print_usage_help_options(27); + printf(USAGE_MAN_TAIL("mkswap(8)")); exit(EXIT_SUCCESS); } diff --git a/login-utils/chfn.c b/login-utils/chfn.c index 7a57e91698..7d14e7b4cf 100644 --- a/login-utils/chfn.c +++ b/login-utils/chfn.c @@ -104,8 +104,8 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -p, --office-phone office phone number\n"), fp); fputs(_(" -h, --home-phone home phone number\n"), fp); fputs(USAGE_SEPARATOR, fp); - fputs(_(" -u, --help display this help and exit\n"), fp); - fputs(_(" -v, --version output version information and exit\n"), fp); + printf( " -u, --help %s\n", USAGE_OPTSTR_HELP); + printf( " -v, --version %s\n", USAGE_OPTSTR_VERSION); fprintf(fp, USAGE_MAN_TAIL("chfn(1)")); exit(EXIT_SUCCESS); } diff --git a/login-utils/chsh.c b/login-utils/chsh.c index 1083583b93..9b19b84f06 100644 --- a/login-utils/chsh.c +++ b/login-utils/chsh.c @@ -83,8 +83,8 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -s, --shell specify login shell\n"), fp); fputs(_(" -l, --list-shells print list of shells and exit\n"), fp); fputs(USAGE_SEPARATOR, fp); - fputs(_(" -u, --help display this help and exit\n"), fp); - fputs(_(" -v, --version output version information and exit\n"), fp); + printf( " -u, --help %s\n", USAGE_OPTSTR_HELP); + printf( " -v, --version %s\n", USAGE_OPTSTR_VERSION); fprintf(fp, USAGE_MAN_TAIL("chsh(1)")); exit(EXIT_SUCCESS); } diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c index 3970a7d3bf..5219425000 100644 --- a/misc-utils/findmnt.c +++ b/misc-utils/findmnt.c @@ -1243,7 +1243,6 @@ static void __attribute__((__noreturn__)) usage(void) fputc('\n', out); fputs(_(" -x, --verify verify mount table content (default is fstab)\n"), out); fputs(_(" --verbose print more details\n"), out); - fputc('\n', out); fputs(USAGE_SEPARATOR, out); print_usage_help_options(24); diff --git a/misc-utils/namei.c b/misc-utils/namei.c index dcaf5d2ebb..92ee22e1fb 100644 --- a/misc-utils/namei.c +++ b/misc-utils/namei.c @@ -336,14 +336,14 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_("Follow a pathname until a terminal point is found.\n"), out); fputs(USAGE_OPTIONS, out); - fputs(_(" -h, --help displays this help text\n" - " -V, --version output version information and exit\n" + fputs(_( " -x, --mountpoints show mount point directories with a 'D'\n" " -m, --modes show the mode bits of each file\n" " -o, --owners show owner and group name of each file\n" " -l, --long use a long listing format (-m -o -v) \n" " -n, --nosymlinks don't follow symlinks\n" " -v, --vertical vertical align of modes and owners\n"), out); + print_usage_help_options(21); fprintf(out, USAGE_MAN_TAIL("namei(1)")); exit(EXIT_SUCCESS); diff --git a/misc-utils/wipefs.c b/misc-utils/wipefs.c index 0bd53253dc..87abba39be 100644 --- a/misc-utils/wipefs.c +++ b/misc-utils/wipefs.c @@ -465,16 +465,15 @@ usage(void) fputs(_(" -a, --all wipe all magic strings (BE CAREFUL!)\n" " -b, --backup create a signature backup in $HOME\n" " -f, --force force erasure\n" - " -h, --help show this help text\n" " -n, --no-act do everything except the actual write() call\n" " -o, --offset offset to erase, in bytes\n" " -p, --parsable print out in parsable instead of printable format\n" " -q, --quiet suppress output messages\n" " -t, --types limit the set of filesystem, RAIDs or partition tables\n" - " -V, --version output version information and exit\n"), out); + ), out); + print_usage_help_options(21); fprintf(out, USAGE_MAN_TAIL("wipefs(8)")); - exit(EXIT_SUCCESS); } diff --git a/schedutils/taskset.c b/schedutils/taskset.c index c55b986fba..ca1734f7ac 100644 --- a/schedutils/taskset.c +++ b/schedutils/taskset.c @@ -61,9 +61,10 @@ static void __attribute__((__noreturn__)) usage(void) " -a, --all-tasks operate on all the tasks (threads) for a given pid\n" " -p, --pid operate on existing given pid\n" " -c, --cpu-list display and specify cpus in list format\n" - " -h, --help display this help\n" - " -V, --version output version information\n\n")); + )); + print_usage_help_options(25); + fputs(USAGE_SEPARATOR, out); fprintf(out, _( "The default behavior is to run a new command:\n" " %1$s 03 sshd -b 1024\n" diff --git a/sys-utils/chcpu.c b/sys-utils/chcpu.c index c0f568073b..620aabfba8 100644 --- a/sys-utils/chcpu.c +++ b/sys-utils/chcpu.c @@ -242,16 +242,18 @@ static void __attribute__((__noreturn__)) usage(void) fputs(USAGE_SEPARATOR, out); fputs(_("Configure CPUs in a multi-processor system.\n"), out); - puts(_( "\nOptions:\n" - " -h, --help print this help\n" - " -e, --enable enable cpus\n" - " -d, --disable disable cpus\n" - " -c, --configure configure cpus\n" - " -g, --deconfigure deconfigure cpus\n" - " -p, --dispatch set dispatching mode\n" - " -r, --rescan trigger rescan of cpus\n" - " -V, --version output version information and exit\n")); - + fputs(USAGE_OPTIONS, stdout); + fputs(_( + " -e, --enable enable cpus\n" + " -d, --disable disable cpus\n" + " -c, --configure configure cpus\n" + " -g, --deconfigure deconfigure cpus\n" + " -p, --dispatch set dispatching mode\n" + " -r, --rescan trigger rescan of cpus\n" + ), stdout); + print_usage_help_options(31); + + printf(USAGE_MAN_TAIL("chcpu(8)")); exit(EXIT_SUCCESS); } diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c index 0db567bfa9..ef12567c35 100644 --- a/sys-utils/dmesg.c +++ b/sys-utils/dmesg.c @@ -318,7 +318,7 @@ static void __attribute__((__noreturn__)) usage(void) fprintf(out, " %7s - %s\n", level_names[i].name, _(level_names[i].help)); - fputs(USAGE_SEPARATOR, out); + fprintf(out, USAGE_MAN_TAIL("dmesg(1)")); exit(EXIT_SUCCESS); } diff --git a/sys-utils/prlimit.c b/sys-utils/prlimit.c index 44db54ca56..37e0f9fed0 100644 --- a/sys-utils/prlimit.c +++ b/sys-utils/prlimit.c @@ -172,8 +172,8 @@ static void __attribute__((__noreturn__)) usage(void) " --noheadings don't print headings\n" " --raw use the raw output format\n" " --verbose verbose output\n" - " -h, --help display this help and exit\n" - " -V, --version output version information and exit\n"), out); + ), out); + print_usage_help_options(24); fputs(_("\nResources Options:\n"), out); fputs(_(" -c, --core maximum size of core files created\n" diff --git a/term-utils/agetty.c b/term-utils/agetty.c index 869513b222..7df5a52681 100644 --- a/term-utils/agetty.c +++ b/term-utils/agetty.c @@ -2110,8 +2110,8 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" --delay sleep seconds before prompt\n"), out); fputs(_(" --nice run login with this priority\n"), out); fputs(_(" --reload reload prompts on running agetty instances\n"), out); - fputs(_(" --help display this help and exit\n"), out); - fputs(_(" --version output version information and exit\n"), out); + printf( " --help %s\n", USAGE_OPTSTR_HELP); + printf( " --version %s\n", USAGE_OPTSTR_VERSION); fprintf(out, USAGE_MAN_TAIL("agetty(8)")); exit(EXIT_SUCCESS); diff --git a/term-utils/script.c b/term-utils/script.c index a93a89ec97..e21affa2be 100644 --- a/term-utils/script.c +++ b/term-utils/script.c @@ -171,8 +171,8 @@ static void __attribute__((__noreturn__)) usage(void) " --force use output file even when it is a link\n" " -q, --quiet be quiet\n" " -t, --timing[=] output timing data to stderr (or to FILE)\n" - " -V, --version output version information and exit\n" - " -h, --help display this help and exit\n\n"), out); + ), out); + print_usage_help_options(25); fprintf(out, USAGE_MAN_TAIL("script(1)")); exit(EXIT_SUCCESS); diff --git a/term-utils/scriptreplay.c b/term-utils/scriptreplay.c index a83f9a2ebf..0a22b9cb81 100644 --- a/term-utils/scriptreplay.c +++ b/term-utils/scriptreplay.c @@ -52,8 +52,8 @@ usage(void) " -s, --typescript script terminal session output file\n" " -d, --divisor speed up or slow down execution with time divisor\n" " -m, --maxdelay wait at most this many seconds between updates\n" - " -V, --version output version information and exit\n" - " -h, --help display this help and exit\n\n"), out); + ), out); + print_usage_help_options(25); fprintf(out, USAGE_MAN_TAIL("scriptreplay(1)")); exit(EXIT_SUCCESS); diff --git a/term-utils/setterm.c b/term-utils/setterm.c index 8ab5b45d79..2878bdb96a 100644 --- a/term-utils/setterm.c +++ b/term-utils/setterm.c @@ -418,8 +418,9 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" --powerdown [0-60] set vesa powerdown interval in minutes\n"), out); fputs(_(" --blength [0-2000] duration of the bell in milliseconds\n"), out); fputs(_(" --bfreq bell frequency in Hertz\n"), out); - fputs(_(" --version show version information and exit\n"), out); - fputs(_(" --help display this help and exit\n"), out); + printf( " --help %s\n", USAGE_OPTSTR_HELP); + printf( " --version %s\n", USAGE_OPTSTR_VERSION); + fprintf(out, USAGE_MAN_TAIL("setterm(1)")); exit(EXIT_SUCCESS); } diff --git a/text-utils/col.c b/text-utils/col.c index a473e55fb0..01ee61b27b 100644 --- a/text-utils/col.c +++ b/text-utils/col.c @@ -142,9 +142,11 @@ static void __attribute__((__noreturn__)) usage(void) " -h, --tabs convert spaces to tabs\n" " -x, --spaces convert tabs to spaces\n" " -l, --lines NUM buffer at least NUM lines\n" - " -V, --version output version information and exit\n" - " -H, --help display this help and exit\n\n")); + )); + printf( " -H, --help %s\n", USAGE_OPTSTR_HELP); + printf( " -V, --version %s\n", USAGE_OPTSTR_VERSION); + fputs(USAGE_SEPARATOR, out); fprintf(out, _( "%s reads from standard input and writes to standard output\n\n"), program_invocation_short_name); diff --git a/text-utils/more.c b/text-utils/more.c index 35786567ab..2a7917120e 100644 --- a/text-utils/more.c +++ b/text-utils/more.c @@ -247,8 +247,8 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" +/ display file beginning from search string match\n"), out); fputs(USAGE_SEPARATOR, out); - fputs(_(" --help display this help and exit\n"), out); - fputs(_(" -V, --version output version information and exit\n"), out); + printf( " --help %s\n", USAGE_OPTSTR_HELP); + printf( " -V, --version %s\n", USAGE_OPTSTR_VERSION); fprintf(out, USAGE_MAN_TAIL("more(1)")); exit(EXIT_SUCCESS); }