From b1a294c448582c5571fbf7c0d363357c88154016 Mon Sep 17 00:00:00 2001 From: Ruediger Meier Date: Sun, 25 Jun 2017 00:19:50 +0200 Subject: misc: introduce print_usage_help_options() Consolidate --help and --version descriptions. We are now able to align them to the other options. We changed include/c.h. The rest of this patch was generated by sed, plus manually setting the right alignment numbers. We do not change anything but white spaces in the --help output. Signed-off-by: Ruediger Meier --- misc-utils/blkid.c | 3 +-- misc-utils/cal.c | 3 +-- misc-utils/fincore.c | 3 +-- misc-utils/findfs.c | 3 +-- misc-utils/findmnt.c | 3 +-- misc-utils/getopt.c | 3 +-- misc-utils/kill.c | 3 +-- misc-utils/logger.c | 3 +-- misc-utils/look.c | 3 +-- misc-utils/lsblk.c | 3 +-- misc-utils/lslocks.c | 3 +-- misc-utils/mcookie.c | 3 +-- misc-utils/rename.c | 3 +-- misc-utils/uuidd.c | 3 +-- misc-utils/uuidgen.c | 3 +-- misc-utils/uuidparse.c | 3 +-- misc-utils/whereis.c | 3 +-- 17 files changed, 17 insertions(+), 34 deletions(-) (limited to 'misc-utils') diff --git a/misc-utils/blkid.c b/misc-utils/blkid.c index f4757e8c8..3aa2ee5a6 100644 --- a/misc-utils/blkid.c +++ b/misc-utils/blkid.c @@ -103,8 +103,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_( " -n, --match-types filter by filesystem type (e.g. -n vfat,ext3)\n"), out); fputs(USAGE_SEPARATOR, out); - fputs(USAGE_HELP, out); - fputs(USAGE_VERSION, out); + print_usage_help_options(28); fprintf(out, USAGE_MAN_TAIL("blkid(8)")); exit(EXIT_SUCCESS); } diff --git a/misc-utils/cal.c b/misc-utils/cal.c index f73cbbf30..870fa689b 100644 --- a/misc-utils/cal.c +++ b/misc-utils/cal.c @@ -1015,8 +1015,7 @@ static void __attribute__((__noreturn__)) usage(void) " %s\n", USAGE_COLORS_DEFAULT); fputs(USAGE_SEPARATOR, out); - fputs(USAGE_HELP, out); - fputs(USAGE_VERSION, out); + print_usage_help_options(23); fprintf(out, USAGE_MAN_TAIL("cal(1)")); exit(EXIT_SUCCESS); diff --git a/misc-utils/fincore.c b/misc-utils/fincore.c index f1b9fa758..9ef912758 100644 --- a/misc-utils/fincore.c +++ b/misc-utils/fincore.c @@ -274,8 +274,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -r, --raw use raw output format\n"), out); fputs(USAGE_SEPARATOR, out); - fputs(USAGE_HELP, out); - fputs(USAGE_VERSION, out); + print_usage_help_options(23); fprintf(out, USAGE_COLUMNS); diff --git a/misc-utils/findfs.c b/misc-utils/findfs.c index c01dc1d53..fc16e44e6 100644 --- a/misc-utils/findfs.c +++ b/misc-utils/findfs.c @@ -33,8 +33,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_("Find a filesystem by label or UUID.\n"), out); fputs(USAGE_OPTIONS, out); - fputs(USAGE_HELP, out); - fputs(USAGE_VERSION, out); + print_usage_help_options(16); fprintf(out, USAGE_MAN_TAIL("findfs(8)")); exit(FINDFS_SUCCESS); } diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c index 5394d1a60..3970a7d3b 100644 --- a/misc-utils/findmnt.c +++ b/misc-utils/findmnt.c @@ -1246,8 +1246,7 @@ static void __attribute__((__noreturn__)) usage(void) fputc('\n', out); fputs(USAGE_SEPARATOR, out); - fputs(USAGE_HELP, out); - fputs(USAGE_VERSION, out); + print_usage_help_options(24); fputs(USAGE_COLUMNS, out); for (i = 0; i < ARRAY_SIZE(infos); i++) diff --git a/misc-utils/getopt.c b/misc-utils/getopt.c index 87d088ed5..8150e3c03 100644 --- a/misc-utils/getopt.c +++ b/misc-utils/getopt.c @@ -346,8 +346,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -T, --test test for getopt(1) version\n"), stdout); fputs(_(" -u, --unquoted do not quote the output\n"), stdout); fputs(USAGE_SEPARATOR, stdout); - fputs(USAGE_HELP, stdout); - fputs(USAGE_VERSION, stdout); + print_usage_help_options(31); printf(USAGE_MAN_TAIL("getopt(1)")); exit(EXIT_SUCCESS); } diff --git a/misc-utils/kill.c b/misc-utils/kill.c index ecee26c4e..0778c6fad 100644 --- a/misc-utils/kill.c +++ b/misc-utils/kill.c @@ -318,8 +318,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" --verbose print pids that will be signaled\n"), out); fputs(USAGE_SEPARATOR, out); - fputs(USAGE_HELP, out); - fputs(USAGE_VERSION, out); + print_usage_help_options(24); fprintf(out, USAGE_MAN_TAIL("kill(1)")); exit(EXIT_SUCCESS); diff --git a/misc-utils/logger.c b/misc-utils/logger.c index 0ae5c61d0..1ef60bb76 100644 --- a/misc-utils/logger.c +++ b/misc-utils/logger.c @@ -1027,8 +1027,7 @@ static void __attribute__((__noreturn__)) usage(void) #endif fputs(USAGE_SEPARATOR, out); - fputs(USAGE_HELP, out); - fputs(USAGE_VERSION, out); + print_usage_help_options(26); fprintf(out, USAGE_MAN_TAIL("logger(1)")); exit(EXIT_SUCCESS); diff --git a/misc-utils/look.c b/misc-utils/look.c index a0d898db1..dfb77319b 100644 --- a/misc-utils/look.c +++ b/misc-utils/look.c @@ -365,8 +365,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -t, --terminate define the string-termination character\n"), out); fputs(USAGE_SEPARATOR, out); - fputs(USAGE_HELP, out); - fputs(USAGE_VERSION, out); + print_usage_help_options(26); fprintf(out, USAGE_MAN_TAIL("look(1)")); exit(EXIT_SUCCESS); diff --git a/misc-utils/lsblk.c b/misc-utils/lsblk.c index d997bc71e..983804b9c 100644 --- a/misc-utils/lsblk.c +++ b/misc-utils/lsblk.c @@ -1658,8 +1658,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -t, --topology output info about topology\n"), out); fputs(_(" -x, --sort sort output by \n"), out); fputs(USAGE_SEPARATOR, out); - fputs(USAGE_HELP, out); - fputs(USAGE_VERSION, out); + print_usage_help_options(22); fprintf(out, USAGE_COLUMNS); diff --git a/misc-utils/lslocks.c b/misc-utils/lslocks.c index 54440496a..d872e2dc7 100644 --- a/misc-utils/lslocks.c +++ b/misc-utils/lslocks.c @@ -507,8 +507,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -u, --notruncate don't truncate text in columns\n"), out); fputs(USAGE_SEPARATOR, out); - fputs(USAGE_HELP, out); - fputs(USAGE_VERSION, out); + print_usage_help_options(24); fputs(USAGE_COLUMNS, out); diff --git a/misc-utils/mcookie.c b/misc-utils/mcookie.c index 89b9a01eb..ce9c4bf44 100644 --- a/misc-utils/mcookie.c +++ b/misc-utils/mcookie.c @@ -91,8 +91,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -v, --verbose explain what is being done\n"), out); fputs(USAGE_SEPARATOR, out); - fputs(USAGE_HELP, out); - fputs(USAGE_VERSION, out); + print_usage_help_options(23); fprintf(out, USAGE_MAN_TAIL("mcookie(1)")); exit(EXIT_SUCCESS); diff --git a/misc-utils/rename.c b/misc-utils/rename.c index 48606d75e..f5029836a 100644 --- a/misc-utils/rename.c +++ b/misc-utils/rename.c @@ -144,8 +144,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -n, --no-act do not make any changes\n"), out); fputs(_(" -o, --no-overwrite don't overwrite existing files\n"), out); fputs(USAGE_SEPARATOR, out); - fputs(USAGE_HELP, out); - fputs(USAGE_VERSION, out); + print_usage_help_options(21); fprintf(out, USAGE_MAN_TAIL("rename(1)")); exit(EXIT_SUCCESS); } diff --git a/misc-utils/uuidd.c b/misc-utils/uuidd.c index faaa0c12f..492ad83d9 100644 --- a/misc-utils/uuidd.c +++ b/misc-utils/uuidd.c @@ -79,8 +79,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -d, --debug run in debugging mode\n"), out); fputs(_(" -q, --quiet turn on quiet mode\n"), out); fputs(USAGE_SEPARATOR, out); - fputs(USAGE_HELP, out); - fputs(USAGE_VERSION, out); + print_usage_help_options(25); fprintf(out, USAGE_MAN_TAIL("uuidd(8)")); exit(EXIT_SUCCESS); } diff --git a/misc-utils/uuidgen.c b/misc-utils/uuidgen.c index 77fda2fb3..8252fd528 100644 --- a/misc-utils/uuidgen.c +++ b/misc-utils/uuidgen.c @@ -32,8 +32,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -r, --random generate random-based uuid\n"), out); fputs(_(" -t, --time generate time-based uuid\n"), out); fputs(USAGE_SEPARATOR, out); - fputs(USAGE_HELP, out); - fputs(USAGE_VERSION, out); + print_usage_help_options(18); fprintf(out, USAGE_MAN_TAIL("uuidgen(1)")); exit(EXIT_SUCCESS); } diff --git a/misc-utils/uuidparse.c b/misc-utils/uuidparse.c index 0938b8559..c3db4271c 100644 --- a/misc-utils/uuidparse.c +++ b/misc-utils/uuidparse.c @@ -105,8 +105,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -r, --raw use the raw output format\n"), stdout); fputs(USAGE_SEPARATOR, stdout); - fputs(USAGE_HELP, stdout); - fputs(USAGE_VERSION, stdout); + print_usage_help_options(24); fputs(USAGE_COLUMNS, stdout); for (i = 0; i < ARRAY_SIZE(infos); i++) diff --git a/misc-utils/whereis.c b/misc-utils/whereis.c index 897a7a213..b4291c4e8 100644 --- a/misc-utils/whereis.c +++ b/misc-utils/whereis.c @@ -205,8 +205,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -l output effective lookup paths\n"), out); fputs(USAGE_SEPARATOR, out); - fputs(USAGE_HELP, out); - fputs(USAGE_VERSION, out); + print_usage_help_options(16); fprintf(out, USAGE_MAN_TAIL("whereis(1)")); exit(EXIT_SUCCESS); } -- cgit v1.2.3-55-g7522 From b30544549505019f5fc092c5d99fcb1cae1a44b1 Mon Sep 17 00:00:00 2001 From: Ruediger Meier Date: Sun, 25 Jun 2017 14:49:47 +0200 Subject: 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 --- disk-utils/fsck.c | 4 ++-- disk-utils/fsck.cramfs.c | 4 ++-- disk-utils/mkfs.bfs.c | 5 ++--- disk-utils/mkfs.c | 5 +---- disk-utils/mkswap.c | 5 +++-- login-utils/chfn.c | 4 ++-- login-utils/chsh.c | 4 ++-- misc-utils/findmnt.c | 1 - misc-utils/namei.c | 4 ++-- misc-utils/wipefs.c | 5 ++--- schedutils/taskset.c | 5 +++-- sys-utils/chcpu.c | 22 ++++++++++++---------- sys-utils/dmesg.c | 2 +- sys-utils/prlimit.c | 4 ++-- term-utils/agetty.c | 4 ++-- term-utils/script.c | 4 ++-- term-utils/scriptreplay.c | 4 ++-- term-utils/setterm.c | 5 +++-- text-utils/col.c | 6 ++++-- text-utils/more.c | 4 ++-- 20 files changed, 51 insertions(+), 50 deletions(-) (limited to 'misc-utils') diff --git a/disk-utils/fsck.c b/disk-utils/fsck.c index 918103ac0..3fe3959c1 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 9fade86d2..465685278 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 b19afa7cd..fbf2887ca 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 25cc59d20..f7b0c0a09 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 73e5258ed..593a61e03 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 7a57e9169..7d14e7b4c 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 1083583b9..9b19b84f0 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 3970a7d3b..521942500 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 dcaf5d2eb..92ee22e1f 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 0bd53253d..87abba39b 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 c55b986fb..ca1734f7a 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 c0f568073..620aabfba 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 0db567bfa..ef12567c3 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 44db54ca5..37e0f9fed 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 869513b22..7df5a5268 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 a93a89ec9..e21affa2b 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 a83f9a2eb..0a22b9cb8 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 8ab5b45d7..2878bdb96 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 a473e55fb..01ee61b27 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 35786567a..2a7917120 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); } -- cgit v1.2.3-55-g7522