mirror of
https://github.com/jlengrand/picocli.git
synced 2026-03-10 08:41:17 +00:00
[#1183] Bugfix: Prevent MissingParameterException thrown when subcommand has required options and help option is specified on parent command
Closes #1183
This commit is contained in:
@@ -118,6 +118,7 @@ only single-value types, and the values in a `Map` (but not the keys!) can be wr
|
||||
* [#1229] Bugfix: Fix compilation error introduced with fc5ef6de6 (#1184). Thanks to [Andreas Deininger](https://github.com/deining) for the pull request.
|
||||
* [#1225] Bugfix: Error message for unmatched positional argument reports incorrect index when value equals a previously matched argument. Thanks to [Vitaly Shukela](https://github.com/vi) for raising this.
|
||||
* [#1250] Bugfix: Inherited positional parameter should not be overridden by default value if placed after subcommand. Thanks to [Daniel Gray](https://github.com/danielthegray) for the pull request.
|
||||
* [#1183] Bugfix: Prevent `MissingParameterException` thrown when subcommand has required options and help option is specified on parent command. Thanks to [drkilikil](https://github.com/drkilikil) for raising this.
|
||||
* [#1215] DOC: User manual improvements, including more tabs with Kotlin source code. Thanks to [Andreas Deininger](https://github.com/deining) for the pull request.
|
||||
* [#1219] DOC: User manual improvements: added more tabs with Kotlin code. Thanks to [Andreas Deininger](https://github.com/deining) for the pull request.
|
||||
* [#1220] DOC: User manual improvements: corrections, more Kotlin tabs. Thanks to [Andreas Deininger](https://github.com/deining) for the pull request.
|
||||
|
||||
@@ -12619,7 +12619,13 @@ public class CommandLine {
|
||||
}
|
||||
} while (!argumentStack.isEmpty() && continueOnError);
|
||||
|
||||
if (!isAnyHelpRequested()) {
|
||||
boolean anyHelpRequested = isAnyHelpRequested();
|
||||
CommandLine parsed = CommandLine.this;
|
||||
while (parsed.getParent() != null) {
|
||||
parsed = parsed.getParent();
|
||||
anyHelpRequested |= parsed.interpreter.isAnyHelpRequested();
|
||||
}
|
||||
if (!anyHelpRequested) {
|
||||
validateConstraints(argumentStack, required, initialized);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2736,7 +2736,6 @@ public class SubcommandTests {
|
||||
assertEquals("An inheritable parameter rooted in a subcommand's root was not itself!", subParamRooted, subsubParamFromSub.root());
|
||||
}
|
||||
|
||||
@Ignore("requires #1183")
|
||||
@Test
|
||||
public void testIssue1183_HelpWithSubcommandWithRequiredOptions() {
|
||||
@Command(name = "app", mixinStandardHelpOptions = true)
|
||||
|
||||
Reference in New Issue
Block a user