bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

doc: argp: A Program Using Multiple Combined Argp Parsers


From: Akim Demaille
Subject: doc: argp: A Program Using Multiple Combined Argp Parsers
Date: Mon, 20 Jan 2003 20:50:25 +0100
User-agent: Mutt/1.5.3i

Hi!

The last section on argp is named "A Program Using Multiple Combined
Argp Parsers", but it's not about that, it's just...

/* Argp example #4 -- a program with somewhat more complicated options
 * */

 /* This program uses the same features as example 3, but has more
    options, and somewhat more structure in the -help output.  It
       also shows how you can `steal' the remainder of the input
          arguments past a certain point, for programs that accept a
             list of items.  It also shows the special argp KEY value
                ARGP_KEY_NO_ARGS, which is only given if no non-option
                   arguments were supplied to the program.

                      For structuring the help output, two features are
                      used,
                         *headers* which are entries in the options
                         vector with the
                            first four fields being zero, and a two part
                            documentation
                               string (in the variable DOC), which
                               allows documentation both
                                  before and after the options; the two
                                  parts of DOC are
                                     separated by a vertical-tab
                                     character ('\v', or '\013').  By
                                        convention, the documentation
                                        before the options is just a
                                           short string saying what the
                                           program does, and that
                                           afterwards
                                              is longer, describing the
                                              behavior in more detail.
                                              All
                                                 documentation strings
                                                 are automatically
                                                 filled for output,
                                                    although newlines
                                                    may be included to
                                                    force a line break
                                                    at a
                                                       particular point.
                                                       All documentation
                                                       strings are also
                                                       passed to
                                                          the `gettext'
                                                          function, for
                                                          possible
                                                          translation
                                                          into the
                                                             current
                                                             locale.  */

Oops, sorry :(  I don't know how to tell vi not to indent :(

Note that you might want to refer to --help in the comment, not -help.

Finally, you might want to use N_ as the text does mention that the help
strings are passed to gettext.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]