Skip to content
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

Provide option to hide default 'completion' cmd #1541

Merged
merged 1 commit into from Dec 7, 2021

Conversation

marckhouzam
Copy link
Collaborator

@marckhouzam marckhouzam commented Nov 24, 2021

Fixes #1507 as requested by @jpmcb

This very simple change adds a user option to allow hiding the default completion command.
So, to tell Cobra to make the default completion command hidden:

rootCmd.CompletionOptions.HiddenDefaultCmd = true

It replace #1523 which was more flexible but much more complicated.

Fixes spf13#1507

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
umarcor pushed a commit to umarcor/cobra that referenced this pull request Nov 24, 2021
Fixes spf13#1507

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
Copy link
Contributor

@Luap99 Luap99 left a comment

LGTM

umarcor pushed a commit to umarcor/cobra that referenced this pull request Nov 25, 2021
Fixes spf13#1507

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
umarcor pushed a commit to umarcor/cobra that referenced this pull request Nov 25, 2021
Fixes spf13#1507

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
umarcor pushed a commit to umarcor/cobra that referenced this pull request Dec 7, 2021
Fixes spf13#1507

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
jpmcb
jpmcb approved these changes Dec 7, 2021
Copy link
Collaborator

@jpmcb jpmcb left a comment

Amazing!!! Thanks Marc!!!

@jpmcb jpmcb merged commit 6f84ef4 into spf13:master Dec 7, 2021
11 checks passed
@jpmcb jpmcb added this to the 1.3.0 milestone Dec 7, 2021
@marckhouzam marckhouzam deleted the feat/hiddenCompCmd branch Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hide auto-generated completion command
3 participants