diff options
author | Sami Kerola | 2017-03-05 21:52:31 +0100 |
---|---|---|
committer | Karel Zak | 2017-03-13 14:48:16 +0100 |
commit | 6cb55736cba05b26117e6e6e85375918a8d9f870 (patch) | |
tree | 99399d66d1bb4bea482c43d91e1c4de847205ea8 /Documentation/boilerplate.c | |
parent | include: fix compiler warning (diff) | |
download | kernel-qcow2-util-linux-6cb55736cba05b26117e6e6e85375918a8d9f870.tar.gz kernel-qcow2-util-linux-6cb55736cba05b26117e6e6e85375918a8d9f870.tar.xz kernel-qcow2-util-linux-6cb55736cba05b26117e6e6e85375918a8d9f870.zip |
docs: improve boilerplate.c options example
Make usage() translations to contain complete option help in single
translation unit. And make -z option example complete.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'Documentation/boilerplate.c')
-rw-r--r-- | Documentation/boilerplate.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Documentation/boilerplate.c b/Documentation/boilerplate.c index b210cc363..7da9374d4 100644 --- a/Documentation/boilerplate.c +++ b/Documentation/boilerplate.c @@ -39,11 +39,11 @@ static void __attribute__((__noreturn__)) usage(FILE *out) fputs(_(" -r, --required <arg> option requires an argument\n"), out); fputs(_(" -z no long option\n"), out); fputs(_(" --xyzzy a long option only\n"), out); - fputs(_(" -e, --extremely-long-long-option\n"), out); - fputs(_(" use next line for description when needed\n"), out); - fputs(_(" -l, --long-explanation an example of very verbose, and chatty option\n"), out); - fputs(_(" description on two, or multiple lines, where the\n"), out); - fputs(_(" consecutive lines are intended by two spaces\n"), out); + fputs(_(" -e, --extremely-long-long-option\n" + " use next line for description when needed\n"), out); + fputs(_(" -l, --long-explanation an example of very verbose, and chatty option\n" + " description on two, or multiple lines, where the\n" + " consecutive lines are intended by two spaces\n"), out); fputs(_(" -f, --foobar next option description resets indent\n"), out); fputs(USAGE_SEPARATOR, out); fputs(USAGE_HELP, out); @@ -77,11 +77,12 @@ int main(int argc, char **argv) textdomain(PACKAGE); atexit(close_stdout); - while ((c = getopt_long(argc, argv, "nr:elfVh", longopts, NULL)) != -1) + while ((c = getopt_long(argc, argv, "nr:zelfVh", longopts, NULL)) != -1) switch (c) { case 'n': case OPT_OPTIONAL: case 'r': + case 'z': case OPT_XYZZY: case 'e': case 'l': |