Skip to content

Commit

Permalink
[#1164] fix broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
remkop committed Nov 25, 2020
1 parent e6b3cd9 commit 965c744
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/picocli/CommandLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -11026,11 +11026,11 @@ static CommandSpec extractCommandSpec(Object command, IFactory factory, boolean
injectSpecIntoVersionProvider(result, cmd, factory);
result.setAddMethodSubcommands(false); // method commands don't have method subcommands
hasCommandAnnotation = true;
initFromMethodParameters(userObject, method, result, null, factory);
initSubcommands(cmd, null, result, factory, new Stack<Class<?>>()); // after adding options
result.mixinStandardHelpOptions(cmd.mixinStandardHelpOptions()); // do this last
initFromMethodParameters(userObject, method, result, null, factory);
// set command name to method name, unless @Command#name is set
result.initName(((Method)command).getName());
result.mixinStandardHelpOptions(cmd.mixinStandardHelpOptions()); // do this last
} else {
Stack<Class<?>> hierarchy = new Stack<Class<?>>();
Class<?> cls = userObject.getType();
Expand All @@ -11050,9 +11050,9 @@ static CommandSpec extractCommandSpec(Object command, IFactory factory, boolean
hasCommandAnnotation = true;
mixinStandardHelpOptions |= cmd.mixinStandardHelpOptions();
}
hasCommandAnnotation |= initFromAnnotatedFields(userObject, cls, result, null, factory, null);
initSubcommands(cmd, cls, result, factory, originalHierarchy); // after adding options
initMethodSubcommands(cls, result, factory); // regardless of @Command annotation. NOTE: after adding options
hasCommandAnnotation |= initFromAnnotatedFields(userObject, cls, result, null, factory, null);
}
result.mixinStandardHelpOptions(mixinStandardHelpOptions); //#377 Standard help options should be added last
}
Expand Down

0 comments on commit 965c744

Please sign in to comment.