I'd like to set some options as required command line arguments, which are required _except_
when someone wants to see the usage text. That is, the command:
foo
throws a missing argument exception (and probably prints usage) because there were missing
required switches of "-s -f filename" switch. And:
foo -s -f file -o -g -l
works because -s and -f file match the required options (and the others weren't). And:
foo -h
prints usage and exits and ignores the required arguments.
I'd think this is fairly common but the only way I see to do this is not use required options
and handle that logic myself. Am I missing something obvious?
john
|