commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Heuer <>
Subject Re: [CLI] Simple usage message
Date Wed, 02 Sep 2009 19:10:02 GMT
Jim Jagielski wrote:

> There are times when add in -h/--help and want to allow people
> to just go ahead and call the app with that option. The rub is, of
> course, if there are any required options, in addition to the usage
> message they also get a superfluous "Missing required" note as well...
> This is, imo at least, ugly. If the consensus is that this would be
> something nice to fix in the 1.x tree (not sure if still an issue in
> 2.x), I'll open a JIRA and start work.

There is a workaround if you have only one required option:

  Options options = ...;
  Option requiredOption = ...;
  Option help = ...;
  OptionGroup requiredOptions = new OptionGroup();

but this doesn't work if you have more than one required option.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message