GNU Info

Info Node: (libc.info)Argp Example 1

(libc.info)Argp Example 1


Next: Argp Example 2 Up: Argp Examples
Enter node , (file) or (file)node

A Minimal Program Using Argp
............................

   This is perhaps the smallest program possible that uses argp.  It
won't do much except give an error messages and exit when there are any
arguments, and prints a rather pointless message for `--help'.

     /* Argp example #1 - a minimal program using argp */
     
     /* This is (probably) the smallest possible program that
        uses argp.  It won't do much except give an error
        messages and exit when there are any arguments, and print
        a (rather pointless) messages for -help. */
     
     #include <argp.h>
     
     int main (int argc, char **argv)
     {
       argp_parse (0, argc, argv, 0, 0, 0);
       exit (0);
     }


automatically generated by info2www version 1.2.2.9