]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
docs: improve boilerplate.c options example
authorSami Kerola <kerolasa@iki.fi>
Sun, 5 Mar 2017 20:52:31 +0000 (20:52 +0000)
committerKarel Zak <kzak@redhat.com>
Mon, 13 Mar 2017 13:48:16 +0000 (14:48 +0100)
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>
Documentation/boilerplate.c

index b210cc363e5e7cbade3f9a51d6c6104fc94d53a6..7da9374d47c54a472b28483748cacd7df7ac2839 100644 (file)
@@ -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':