Replies: 1 comment 1 reply
-
The SystemCompleter stuff is a JLine API, so there is no connection with specific picocli options. You can add generic completers, or completers for JLine commands. The picocli API actually provides an API that is very similar to what you mentioned as "Ideally if I could specify the completer via annotation on specific options?" The API that picocli provides uses the @CommandLine.Option(names = "-myoption",
completionCandidates = FilesCompleter.class)
File f; So, picocli can already do this with the completionCandidates attribute of the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I am experimenting with picocli.shell.jline3.PicocliCommands and I was trying to figure out the best way to get it to tab complete for options that are expected to be a local file.
I've done something like this:
private static class MyCommands extends PicocliCommands {
private final Supplier workDir;
}
It seems to generally work, but file completion ends up happening in all contexts within "mycommand1" and "mycommand2" rather than just in contexts where I've specified a File. Was wondering if there's something simple I'm missing. Ideally if I could specify the completer via annotation on specific options? So something like:
@CommandLine.Option(names = "-myoption",
completer=FilesCompleter.class)
private File value;
Beta Was this translation helpful? Give feedback.
All reactions