Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.2
-
None
-
Java obviously.
Description
Let's say we have the required options a, b, c, d, e, f, ...., z.
And we have a single optional option "help".
So, I enter
>java blah..blah ..blah mainClass -help.
It ends up with catching the missing option exception. There is no way of specifying that if -help is supplied then all mandatory options are ignored.
The way around it is to double parse the args, or to override the parser, the hassle of which defeats the purpose of using CLI.
You should have a new method
> public void parse(
CommandLine cmd, Options options, String[] arguments,
Properties properties, boolean stopAtNonOption)
throws ParseException;
So that, on exception, I could still have a handle to cmd object, which I would determine if "-help" was specified.
Attachments
Issue Links
- duplicates
-
CLI-179 Needs "standalone" options that can be used even if required options are not set
- Open