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 <ruediger.meier@ga-group.nl>
This commit is contained in:
Ruediger Meier 2017-06-25 14:49:47 +02:00
parent b1a294c448
commit b305445495
20 changed files with 50 additions and 49 deletions

View 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)"));

View 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);
}

View 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);

View 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);
}

View 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);
}

View 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);
}

View 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);
}

View 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);

View 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);

View 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);
}

View 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"

View 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);
}

View 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);
}

View 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"

View 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);

View 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);

View 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);

View 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);
}

View 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);

View 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);
}