Skip to content

Commit

Permalink
Make CommandLine in AutoComplete use correct IFactory implementation
Browse files Browse the repository at this point in the history
In some cases using the DefaultFactory when instantiating CommandLine
could cause subcommands that require a specific IFactory
implementation to fail to be created. This commit makes the
CommandLine instance created by AutoComplete command use the
IFactory passed to the command (if any).
  • Loading branch information
quinn-harper authored and remkop committed Jan 14, 2019
1 parent af622c1 commit 1d3fac3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/picocli/AutoComplete.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public Integer call() {
}
Class<?> cls = Class.forName(commandLineFQCN);
Object instance = factory.create(cls);
CommandLine commandLine = new CommandLine(instance);
CommandLine commandLine = new CommandLine(instance, factory);

if (commandName == null) {
commandName = commandLine.getCommandName(); //new CommandLine.Help(commandLine.commandDescriptor).commandName;
Expand Down

0 comments on commit 1d3fac3

Please sign in to comment.