![]() Slice Tools libFoundation |
example-options.outSample output from example-options.In each case, the commmand to get the option precedes the output. Data written to stderr is prefixed with (stderr). ./example-options -h (stderr) Foundation command line options example --append Log messages should append to old logfile --configfile <argument> Set the config file --debug <argument> Set filter levels for logging (fl[,Category=fl[...]] --filterlevel <argument> Set filter levels for logging (fl[,Category=fl[...]] --depend Get dependency information -h Get this help --help Get this help --logfile <argument> Set logfile for logging -V Get the version info --version Get the version info -a <argument> Set an int value for a (default=5432) -b <argument> Set a float value for b (default=5432.11) -c <argument> Set a string value for c (default=5432.11) --doA Run workA() --doB Run workB() --notestoptions Disables Test the options handling --testoptions Test the options handling ./example-options -a 123 --doA In doWorkA() a=123 ./example-options -b 123.q --doB (stderr) Error: Options: Invalid Option: Non-float value in 123.q for b in module FloatOptionResult::setVal ./example-options -c "a very long string" In doWorkC() c=a very long string ./example-options --testoptions file file1 -------------------------- Testing Options -------------------------- Application Filespec is: ./example-options Application Name is: example-options Invocation Was: ./example-options --testoptions file file1 Option Found: V was not specified Option Found: a was not specified Option Found: append was not specified Option Found: b was not specified Option Found: c was not specified Option Found: configfile was not specified Option Found: debug was not specified Option Found: depend was not specified Option Found: doA was not specified Option Found: doB was not specified Option Found: filterlevel was not specified Option Found: h was not specified Option Found: help was not specified Option Found: logfile was not specified Option Found: notestoptions was not specified Option Found: testoptions exists Option Found: version was not specified Other Data: file Other Data: file1 |