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

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.

umarcor pushed a commit to umarcor/cobra that referenced this pull request Nov 24, 2021
Copy link
Contributor

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

umarcor pushed a commit to umarcor/cobra that referenced this pull request Nov 25, 2021
umarcor pushed a commit to umarcor/cobra that referenced this pull request Nov 25, 2021
umarcor pushed a commit to umarcor/cobra that referenced this pull request Dec 7, 2021
Copy link
Collaborator

@jpmcb jpmcb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing!!! Thanks Marc!!!

@jpmcb jpmcb merged commit 6f84ef4 into spf13:master Dec 7, 2021
@jpmcb jpmcb added this to the 1.3.0 milestone Dec 7, 2021
@marckhouzam marckhouzam deleted the feat/hiddenCompCmd branch December 8, 2021 00:13
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