commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sigler, John" <John.Sig...@sabre.com>
Subject [CLI] required options vs. usage
Date Fri, 09 May 2003 16:22:29 GMT
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
support and write my own logic to do this. It's not difficult but I'm just wondering if I
am missing something obvious?

john

Mime
View raw message