inet/resolv: Try search domains first for unqualified names
[uclibc-ng.git] / test / argp / argp-ex2.c
blobc49fbaca94b7af9c9a50b6c53c820160c0b21826
1 /* Argp example #2 -- a pretty minimal program using argp */
3 /* This program doesn't use any options or arguments, but uses
4 argp to be compliant with the GNU standard command line
5 format.
7 In addition to making sure no arguments are given, and
8 implementing a --help option, this example will have a
9 --version option, and will put the given documentation string
10 and bug address in the --help output, as per GNU standards.
12 The variable ARGP contains the argument parser specification;
13 adding fields to this structure is the way most parameters are
14 passed to argp_parse (the first three fields are usually used,
15 but not in this small program). There are also two global
16 variables that argp knows about defined here,
17 ARGP_PROGRAM_VERSION and ARGP_PROGRAM_BUG_ADDRESS (they are
18 global variables because they will almost always be constant
19 for a given program, even if it uses different argument
20 parsers for various tasks). */
22 #include <stdlib.h>
23 #include <argp.h>
25 const char *argp_program_version =
26 "argp-ex2 1.0";
27 const char *argp_program_bug_address =
28 "<bug-gnu-utils@@gnu.org>";
30 /* Program documentation. */
31 static char doc[] =
32 "Argp example #2 -- a pretty minimal program using argp";
34 /* Our argument parser. The @code{options}, @code{parser}, and
35 @code{args_doc} fields are zero because we have neither options or
36 arguments; @code{doc} and @code{argp_program_bug_address} will be
37 used in the output for @samp{--help}, and the @samp{--version}
38 option will print out @code{argp_program_version}. */
39 static struct argp argp = { 0, 0, 0, doc };
41 int main (int argc, char **argv)
43 argp_parse (&argp, argc, argv, 0, 0, 0);
44 exit (0);