]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
misc: consolidate all --help option descriptions
authorRuediger Meier <ruediger.meier@ga-group.nl>
Sun, 25 Jun 2017 12:49:47 +0000 (14:49 +0200)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Tue, 27 Jun 2017 10:28:36 +0000 (12:28 +0200)
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 <ruediger.meier@ga-group.nl>
20 files changed:
disk-utils/fsck.c
disk-utils/fsck.cramfs.c
disk-utils/mkfs.bfs.c
disk-utils/mkfs.c
disk-utils/mkswap.c
login-utils/chfn.c
login-utils/chsh.c
misc-utils/findmnt.c
misc-utils/namei.c
misc-utils/wipefs.c
schedutils/taskset.c
sys-utils/chcpu.c
sys-utils/dmesg.c
sys-utils/prlimit.c
term-utils/agetty.c
term-utils/script.c
term-utils/scriptreplay.c
term-utils/setterm.c
text-utils/col.c
text-utils/more.c

index 918103ac0c87058d3ffebf7a5587610a0aa70407..3fe3959c19df9b5adc08baa2ec1cfdda84bfb0b0 100644 (file)
@@ -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)"));
index 9fade86d22d8de29f82600c6ad87027d04792746..46568527822fe82cfbdb835a8b8f6eede1804a26 100644 (file)
@@ -120,9 +120,9 @@ static void __attribute__((__noreturn__)) usage(void)
        fputs(_(" -b, --blocksize <size>   use this blocksize, defaults to page size\n"), out);
        fputs(_("     --extract[=<dir>]    test uncompression, optionally extract into <dir>\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);
 }
 
index b19afa7cdfdf1b4d28cbd52a1f54ddb244a5f87f..fbf2887caf176fe399b57b4f09b4c75d7094f9b8 100644 (file)
@@ -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);
index 25cc59d20df9746ebc27217c11a9d0041f3ca73d..f7b0c0a0904b7b19db92fde3fcdbe6f750e24aa4 100644 (file)
@@ -55,12 +55,9 @@ static void __attribute__((__noreturn__)) usage(void)
        fprintf(out, _("     <size>         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);
 }
 
index 73e5258ed3784cc368f8dd333ca6b162af573879..593a61e03de174fb512730e19616c5f47274bd1c 100644 (file)
@@ -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);
 }
 
index 7a57e916989ff3ca496b6070cab41d7a7562917c..7d14e7b4cfe59992c409ded8055ba44be7ea87a5 100644 (file)
@@ -104,8 +104,8 @@ static void __attribute__((__noreturn__)) usage(void)
        fputs(_(" -p, --office-phone <phone>   office phone number\n"), fp);
        fputs(_(" -h, --home-phone <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);
 }
index 1083583b931e947c94f0a5678c7ea24bb000e947..9b19b84f06dbd3ceb95476b81e8808b4ebc479b7 100644 (file)
@@ -83,8 +83,8 @@ static void __attribute__((__noreturn__)) usage(void)
        fputs(_(" -s, --shell <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);
 }
index 3970a7d3bf6827d912a1c16a0f8c068f48b08bcd..5219425000fb66a8b3f8ae9bb77e64033eb37c22 100644 (file)
@@ -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);
index dcaf5d2ebb49bf2ce3f4336d0b0b63bd3adc83c0..92ee22e1fbd0ed07372664866993da83a9d95baf 100644 (file)
@@ -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);
index 0bd53253dcaa0b049e281ee412798e40f54291eb..87abba39be7bf977fc91ee4948fdec775c596ebb 100644 (file)
@@ -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 <num>  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 <list>  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);
 }
 
index c55b986fbaa208d4ec69fe060ba493673e4de28d..ca1734f7acd3de66f0db5c4084fc9d80aa28cb44 100644 (file)
@@ -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"
index c0f568073b64596b904587ad0701d25b02ab6121..620aabfba89934e7b83a0e66f143f2d6a666a875 100644 (file)
@@ -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 <cpu-list>       enable cpus\n"
-               "  -d, --disable <cpu-list>      disable cpus\n"
-               "  -c, --configure <cpu-list>    configure cpus\n"
-               "  -g, --deconfigure <cpu-list>  deconfigure cpus\n"
-               "  -p, --dispatch <mode>         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 <cpu-list>       enable cpus\n"
+               " -d, --disable <cpu-list>      disable cpus\n"
+               " -c, --configure <cpu-list>    configure cpus\n"
+               " -g, --deconfigure <cpu-list>  deconfigure cpus\n"
+               " -p, --dispatch <mode>         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);
 }
 
index 0db567bfa96b3169365564d4b9fba83f2eab35c1..ef12567c35c6bf4f7b0599c5e14a3552ff5f3c03 100644 (file)
@@ -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);
 }
index 44db54ca566f84bd487840db284ae52445ee99b6..37e0f9fed04bbc9b125eca00f63a31a4a64ca155 100644 (file)
@@ -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"
index 869513b22266b9445939868a9e325b915f8d5ea8..7df5a526816c789e4b6ef4e18eaa353bec518c4a 100644 (file)
@@ -2110,8 +2110,8 @@ static void __attribute__((__noreturn__)) usage(void)
        fputs(_("     --delay <number>       sleep seconds before prompt\n"), out);
        fputs(_("     --nice <number>        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);
index a93a89ec97911445efb75c5f3e94cafccf94d11a..e21affa2be4e1b67315bd1112e34bd0c14344c9c 100644 (file)
@@ -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[=<file>]   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);
index a83f9a2ebf7362927f6239ed1aff73b38262f9c1..0a22b9cb818b8b551fdfb48f58bb57f7ef61faa7 100644 (file)
@@ -52,8 +52,8 @@ usage(void)
                " -s, --typescript <file> script terminal session output file\n"
                " -d, --divisor <num>     speed up or slow down execution with time divisor\n"
                " -m, --maxdelay <num>    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);
index 8ab5b45d796fb5adeb6f2bedb133c00cd1dd0d66..2878bdb96a64e0194a0ba19aff8935eb407e1330 100644 (file)
@@ -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         <number>          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);
 }
index a473e55fb0085cb5b217c0ddc8802c0d8aa8ea6a..01ee61b27b115fe03804711bb960fc7b89fdf93c 100644 (file)
@@ -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);
index 35786567ab257bfdfc48c0df03022146a52a8b99..2a7917120ed12bb443f9be995fd8a336a65955e8 100644 (file)
@@ -247,8 +247,8 @@ static void __attribute__((__noreturn__)) usage(void)
        fputs(_(" +/<string>  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);
 }