E
ern
Is there a standard (or easy) way to parse parameters (configs) that
come from main(int argc, char *argv[]) ?
For example,
If I have the following configurations:
-s <string> // pass a string to main
-f <file> // pass a file to main
-i <integer> // pass an integer to main
-d // set the 'doStuff' flag
as well as being able to send any arbitrary command to main(), are
there any proven methods of parsing the configurations? It seems like
option-parsing code would already exist, but I can't find any. The
option-parsing in the code I'm debugging is messy and unacceptable.
I'd like to start from scratch. For Python minded people, I'm looking
for an equivalent to 'optparse'.
come from main(int argc, char *argv[]) ?
For example,
If I have the following configurations:
-s <string> // pass a string to main
-f <file> // pass a file to main
-i <integer> // pass an integer to main
-d // set the 'doStuff' flag
as well as being able to send any arbitrary command to main(), are
there any proven methods of parsing the configurations? It seems like
option-parsing code would already exist, but I can't find any. The
option-parsing in the code I'm debugging is messy and unacceptable.
I'd like to start from scratch. For Python minded people, I'm looking
for an equivalent to 'optparse'.