picocli
picocli copied to clipboard
Autocomplete completely ignores arity
Given a command with arity > 1 (and not a file / path type), autcomplete will only work for the first value. Given the code:
@Command(mixinStandardHelpOptions = true)
public static class DummyCommand {
@Option(names = "--values", completionCandidates = CandidatesCompletion.class, arity = "2")
public String[] values;
public static class CandidatesCompletion implements Iterable<String> {
@Override
public Iterator<String> iterator() {
return Arrays.asList("option1", "option2", "option3").iterator();
}
}
}
The behavior observed under zsh is as follows:
First value (correct):
$ mycommand --values option<TAB><TAB>
option1 option2 option3
Second value (incorrect):
$ mycommand --values option1 op<TAB><TAB>
(empty, or files starting with "op")