[
https://issues.apache.org/jira/browse/CLI-179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16092834#comment-16092834
]
Ingo Weiss edited comment on CLI-179 at 7/19/17 9:22 AM:
---------------------------------------------------------
[~ebourg], I don't quite understand your suggestion here. If I set the option
group as required then it will require to have a --help or --version but that
doesn't translate to "if --help or --version are provided, skip the required
options list outside this option group".
Here is a practical example:
{noformat}
java -jar app.jar --help
Missing required options: s, t
usage: server-migration [-e <environment file>] [-h] [-i <true/false>] -s
<source> -t <target>
-e,--environment <environment file> env
-h,--help help
-i,--interactive <true/false> int
-s,--source <source> src
-t,--target <target> tgt
{noformat}
If I provide -s and -t then all is fine and help is printed as expected. If I
don't provide any options, than this message is correct, s and t are indeed
missing.
was (Author: iweiss):
[~ebourg], I don't quite understand your suggestion here. If I set the option
group as required then it will require to have a --help or --version but that
doesn't translate to "if --help or --version are provided, skip the required
options list outside this option group".
> Needs "standalone" options that can be used even if required options are not
> set
> --------------------------------------------------------------------------------
>
> Key: CLI-179
> URL: https://issues.apache.org/jira/browse/CLI-179
> Project: Commons CLI
> Issue Type: Improvement
> Components: Parser
> Affects Versions: 1.2
> Reporter: Joël Royer
> Attachments: CLI-179.patch
>
>
> it is currently impossible to have options like "help" or "version" if we
> also have some required options. The parsing results in an error "Missing
> parameters".
> But for an "help" or "version" option, it would be usefull to display the
> wanted information, even if required options are not set.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)