Copyright (C) 2000-2012 |
GNU Info (libc.info)Parsing Program ArgumentsParsing Program Arguments ------------------------- If the syntax for the command line arguments to your program is simple enough, you can simply pick the arguments off from ARGV by hand. But unless your program takes a fixed number of arguments, or all of the arguments are interpreted in the same way (as file names, for example), you are usually better off using `getopt' (Note: Getopt) or `argp_parse' (Note: Argp) to do the parsing. `getopt' is more standard (the short-option only version of it is a part of the POSIX standard), but using `argp_parse' is often easier, both for very simple and very complex option structures, because it does more of the dirty work for you.
automatically generated by info2www version 1.2.2.9 |