-
Notifications
You must be signed in to change notification settings - Fork 422
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
GenerateCompletion command only works if used as direct subcommand of root #1051
Comments
Yes, currently the Will you be able to provide a pull request (with test) for this? |
The implementation for this is fairly straightforward: just replace String script = AutoComplete.bash(
spec.parent().name(),
spec.parent().commandLine()); with String script = AutoComplete.bash(
spec.root().name(),
spec.root().commandLine()); But we do need some tests to verify that this works for your use case (and perhaps another one where the completion command is nested even deeper). |
The code is simple indeed. But, there is one thing missing: a pre-defined variable for root name (ROOT-COMMAND-NAME?) so that the command description |
Yes, it makes sense to add a |
I'm coding a PR. |
I'm trying to use it in a sub-subcommand such as
mycommand setup generate-completion
instead of
mycommand generate-completion
Unfortunatly, this generates autocompletion for
setup
and notmycommand
.The text was updated successfully, but these errors were encountered: