-
Notifications
You must be signed in to change notification settings - Fork 445
Closed
Description
Issue
I was playing around with the subcommands and suddenly I got an unmatched argument exception but I think this might bug.
Running the following command test start sta or test restart rest tries to autocorrect the sta and/or rest to their subcommand.
The command never runs and it just says Did you mean: restart or start?
@Command(name = "test", mixinStandardHelpOptions = true)
public class TestCommand implements Callable<Integer> {
@Override
public Integer call() throws Exception { throw new ParameterException(spec.commandLine(), "Missing required subcommand"); }
@Command(name = "start", description = "start", mixinStandardHelpOptions = true)
public int start(
@Parameters(index = "0", paramLabel = "id") String id) { return 0; }
@Command(name = "restart", description = "restart", mixinStandardHelpOptions = true)
public int restart(
@Parameters(index = "0", paramLabel = "id") String id) { return 0; }
}I'm running the command using the CommandLine object as follows:
new CommandLine(new TestCommand()).execute("restart", "rest")
new CommandLine(new TestCommand()).execute("start", "sta")Environment
Operating System Windows 10
IDE Eclipse 2020-12 (4.18.0)
Picoclli Picocli version 4.6.1
Metadata
Metadata
Assignees
Labels
No labels