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

The root help shows deprecated command #165

Open
marckhouzam opened this issue Apr 4, 2023 · 0 comments
Open

The root help shows deprecated command #165

marckhouzam opened this issue Apr 4, 2023 · 0 comments
Labels
kind/bug PR/issue related to a bug needs-triage

Comments

@marckhouzam
Copy link
Contributor

Bug description

Deprecated commands are not normally shown in the help by Cobra.
The CLI overrides the help logic to format it using grouping of commands, and in doing so, it no longer ignores deprecated commands.

So tanzu -h shows the deprecated login command, but doing tanzu l[tab] will not suggest login because cobra does not consider it a command that should be shown.

On the other hand, a deprecated sub-command of the tanzu CLI is hidden in the help as the help logic is not overridden for sub-commands.

Expected behavior

We should have a consistent behaviour for showing or not a deprecated command in the help.
And to match the behaviour of the shell completion, I recommend we don't show deprecated commands in the help, like cobra normally behaves.

Steps to reproduce the bug / Relevant debug output

# Notice the login command is shown although it is deprecated
tz -h | grep login

# Notice the "config server" command is not shown because it is deprecated
tz config -h | grep server

Output of tanzu version

sha: cd55b11

Environment where the bug was observed (cloud, OS, etc)

Locally

@marckhouzam marckhouzam added kind/bug PR/issue related to a bug needs-triage labels Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug PR/issue related to a bug needs-triage
Projects
None yet
Development

No branches or pull requests

2 participants
@marckhouzam and others