-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hierarchical commands easy setup #90
Comments
I see the use case. I haven't run into yet though, mostly because most of the commands I define take options, so that a strict hierarchical completion does not really help.
which would mean : 0 or more occurrences of c1 or c2 or c3, eventually followed by c4, followed by one or more c5, where c[1-9] would be keys into a |
See jline3/builtins/src/test/java/org/jline/example/Example.java Lines 163 to 180 in 104a5eb
|
Really neat way to specify a tree-like commands structure. Just for people that would need "hint" for certain values to insert I created a class like this:
and then I modified Completer.java like this:
|
Setting up a Completer is very flexible but sometimes it generates a long piece of code that is also quite difficult to read. It would be really nice to have a Completer that can be setup with a tree-like structure whose nodes contain a List of Candidates. This approach doesn't cover all possible scenarios but it is very useful in most cases. Consider a Cisco-like CLI for example.
I think the same approach is used in https://github.com/dparrish/libcli
The text was updated successfully, but these errors were encountered: