-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[feature request] completion for --help/--version #1786
Labels
Comments
Agreed. I consider this a bug. I haven't looked at why the completion doesn't work for those flags but I feel it should. |
marckhouzam
added
kind/bug
A bug in cobra; unintended behavior
area/shell-completion
All shell completions
labels
Aug 23, 2022
marckhouzam
added a commit
to marckhouzam/cobra
that referenced
this issue
Sep 20, 2022
Fixes spf13#1786 The --help, -h, --version and -v flags are normally added when the `execute()` function is called on a command. When doing completion we don't call `execute()` so we need to add these flags explicitly to the command being completed. Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com>
marckhouzam
added a commit
to marckhouzam/cobra
that referenced
this issue
Oct 1, 2022
Fixes spf13#1786 The --help, -h, --version and -v flags are normally added when the `execute()` function is called on a command. When doing completion we don't call `execute()` so we need to add these flags explicitly to the command being completed. Also, we disable all further completions if the 'help' or 'version' flags are present on the command-line. Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com>
marckhouzam
added a commit
to marckhouzam/cobra
that referenced
this issue
Oct 1, 2022
Fixes spf13#1786 The --help, -h, --version and -v flags are normally added when the `execute()` function is called on a command. When doing completion we don't call `execute()` so we need to add these flags explicitly to the command being completed. Also, we disable all further completions if the 'help' or 'version' flags are present on the command-line. Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com>
jpmcb
pushed a commit
that referenced
this issue
Oct 4, 2022
Fixes #1786 The --help, -h, --version and -v flags are normally added when the `execute()` function is called on a command. When doing completion we don't call `execute()` so we need to add these flags explicitly to the command being completed. Also, we disable all further completions if the 'help' or 'version' flags are present on the command-line. Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Hi.
It would be nice to allow the user to auto complete flags like
--help,
--version` etc.For example, the
git
completion allowsgit --v[TAB]
to auto complete togit --version
.TIA
The text was updated successfully, but these errors were encountered: