in reply to Re^7: how to deal with 20 commands
in thread how to deal with 20 commands
#include <stdio.h> #include <getopt.h> int main (argc, argv) int argc; char **argv; { /* ... */ getopt_long (argc, argv, "abc:d:012", /* short spec */ long_options, &option_index); /* ... */ }
The "argc" and "argv" you're passing the library function getopt_long just happen to be the ones given to you on the command line. But if you'd have constructed any other, er, argument vector, you could have passed that instead.
The same thing happens in Java, when your entry point accepts a String args[], and passes that (or a different String[]) to the options parsing library.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: how to deal with 20 commands
by thor (Priest) on May 24, 2005 at 11:18 UTC | |
by gaal (Parson) on May 24, 2005 at 12:56 UTC |