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

fix: fix command aliases #1263

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

mouchar
Copy link

@mouchar mouchar commented Nov 15, 2023

Motivation

Attempt to use built-in bash completion provided by cobra package fails on invalid shell expressions.
During investigation I noticed it is caused by declaring empty strings ("") as command aliases. Fortunately, command
aliases are passed as variadic arguments so fix is very simple and doesn't require substantial changes.

Modifications

  • I removed pointless empty ("") aliases as they break bash completion
  • I remove aliases that are the same as primary command name
  • I aligned cmdutils.NewResourceCmd parameters in test_help.go to match call parameters in their respective Command functions.

Verifying this change

  • Make sure that the change passes the CI checks.

This change is a trivial rework / code cleanup without any test coverage.

Documentation

Check the box below.

Need to update docs?

  • doc-required

    (If you need help on updating docs, create a doc issue)

  • no-need-doc

My changes do not modify logic or public command-line interface.

  • doc

    (If this PR contains doc changes)

* remove aliases that are the same as primary command name
* remove pointless empty ("") aliases as they break bash completion
* align cmdutils.NewResourceCmd parameters in test_help.go to match
  call parameters in its respective Command.

Signed-off-by: Robert Moucha <[email protected]>
@github-actions github-actions bot added the no-need-doc This pr does not need any document label Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-need-doc This pr does not need any document
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant