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

Add Aliases completions on ZSH #1014

Closed
wants to merge 1 commit into from

Conversation

chmouel
Copy link

@chmouel chmouel commented Jan 7, 2020

This add ZSH completion on command aliases

Signed-off-by: Chmouel Boudjnah <chmouel@chmouel.com>
chmouel added a commit to chmouel/tektoncd-cli that referenced this pull request Jan 7, 2020
This will add ZSH aliases support pulled from my fork (and submitted upstream
at spf13/cobra#1014) and update to the latest pflags and cobra support.

Fixes tektoncd#317
tekton-robot pushed a commit to tektoncd/cli that referenced this pull request Jan 7, 2020
This will add ZSH aliases support pulled from my fork (and submitted upstream
at spf13/cobra#1014) and update to the latest pflags and cobra support.

Fixes #317
@github-actions
Copy link

github-actions bot commented Apr 3, 2020

This PR is being marked as stale due to a long period of inactivity

@chmouel
Copy link
Author

chmouel commented Apr 3, 2020

It's not stalled fyi, just nobody wants to merge this 😭

Copy link
Contributor

@xchapter7x xchapter7x left a comment

Choose a reason for hiding this comment

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

@jharshman
Ideally, would like to see some negative test cases ...

Otherwise this
LGTM

@@ -7,6 +7,38 @@ import (
"testing"
)

func TestGenZshAliases(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@chmouel excellent job on this PR.

I'd be curious to see some negative test cases (ie. no aliases, empty aliases array, etc)

@marckhouzam
Copy link
Collaborator

Bash completion does not complete command aliases.
I'm not sure why this is. Maybe the idea is that we don't want to guide the users to use aliases, but only to use the main command?

Also, be aware that the current zsh script may get replaced by #1070

@marckhouzam
Copy link
Collaborator

marckhouzam commented Jul 14, 2020

The zsh completion script has been completely changed by #1070 so this PR no longer applies.

@chmouel Note that Cobra's shell completion, including the new zsh logic, does not complete aliases. This seems to be done by design. If you feel aliases should be completed, I recommended opening new PR and arguing the value for it.

@jpmcb I believe we can close this one now that #1070 has been merged.

@jpmcb
Copy link
Collaborator

jpmcb commented Jul 14, 2020

Thanks for letting me know @marckhouzam!! Glad we are getting some things cleaned up

@chmouel thank you so much for the contributions and PRs, apologies for not being able to get them in before the zsh revamp.

@jpmcb jpmcb closed this Jul 14, 2020
@chmouel
Copy link
Author

chmouel commented Jul 16, 2020

@marckhouzam why would you assume this is "by design" ?

@marckhouzam
Copy link
Collaborator

@chmouel You are right, I don't actually have a confirmation it was by design.

Personally I feel command aliases should be completed somehow, either fully like you suggest or only when there are no other completions, as is done for argument aliases. Not sure which is best.

I encourage you to post a PR (since this one was no longer applicable).

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.

4 participants