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 zsh completion: unknown file attribute error #38104

Merged
merged 1 commit into from
Feb 24, 2017

Conversation

elipapa
Copy link
Contributor

@elipapa elipapa commented Dec 5, 2016

What this PR does / why we need it:
Fixes zsh completion.

Sourcing the file with zsh > 4 resulted in an unknown file attribute.
More details at http://stackoverflow.com/questions/37220495/zsh-unknown-file-attribute

@k8s-ci-robot
Copy link
Contributor

Can a kubernetes member verify that this patch is reasonable to test? If so, please reply with "@k8s-bot ok to test" on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands will still work. Regular contributors should join the org to skip this step.

If you have questions or suggestions related to this bot's behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://github.com/kubernetes/kubernetes/wiki/CLA-FAQ to sign the CLA.

Once you've signed, please reply here (e.g. "I signed it!") and we'll verify. Thanks.


If you have questions or suggestions related to this bot's behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.

1 similar comment
@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://github.com/kubernetes/kubernetes/wiki/CLA-FAQ to sign the CLA.

Once you've signed, please reply here (e.g. "I signed it!") and we'll verify. Thanks.


If you have questions or suggestions related to this bot's behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Dec 5, 2016
@k8s-reviewable
Copy link

This change is Reviewable

@elipapa
Copy link
Contributor Author

elipapa commented Dec 5, 2016

I signed it

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Dec 5, 2016
@k8s-github-robot k8s-github-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. release-note-label-needed labels Dec 5, 2016
@sttts sttts added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-label-needed labels Dec 5, 2016
@sttts sttts assigned sttts and unassigned smarterclayton Dec 5, 2016
@sttts sttts changed the title solving unknown file attribute error Fix zsh completion: unknown file attribute error Dec 5, 2016
@@ -258,6 +258,7 @@ fi
__kubectl_convert_bash_to_zsh() {
sed \
-e 's/declare -F/whence -w/' \
-e 's/\$\@/\$\{\*\}/' \
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure about this change. Which $@ does it apply to?

@sttts
Copy link
Contributor

sttts commented Dec 5, 2016

@elipapa can you try this:

source <(kubectl completion zsh | sed 's/_get_comp_words_by_ref "\$@"/_get_comp_words_by_ref "\$*"/')

@sttts
Copy link
Contributor

sttts commented Dec 5, 2016

@elipapa ^^ tested here with zsh 5.2. works fine.

@elipapa
Copy link
Contributor Author

elipapa commented Dec 5, 2016 via email

@sttts
Copy link
Contributor

sttts commented Dec 5, 2016

I don't like the global s/\$\@/\$\{\*\}/. It does more than necessary, potentially introducing new regressions.

@sttts
Copy link
Contributor

sttts commented Dec 6, 2016

Which of the $@ breaks for you:

kubectl completion bash | grep '$@'
    _get_comp_words_by_ref "$@" cur prev words cword
    for w in "$@"; do
    for w in "$@"; do

@sttts
Copy link
Contributor

sttts commented Jan 8, 2017

Any news on this?

@k8s-github-robot
Copy link

[APPROVALNOTIFIER] Needs approval from an approver in each of these OWNERS Files:

We suggest the following people:
cc @sig-cli-maintainers
You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@adohe-zz
Copy link

adohe-zz commented Feb 4, 2017

@elipapa any updates?

@elipapa
Copy link
Contributor Author

elipapa commented Feb 23, 2017

I have retested the previous suggestion on a different system

source <(kubectl completion zsh | sed 's/_get_comp_words_by_ref "\$@"/_get_comp_words_by_ref "\$*"/')

and it does indeed work.

@sttts
Copy link
Contributor

sttts commented Feb 24, 2017

Lgtm. Please squash ASAP to get it into 1.6.

@sttts sttts added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. retest-not-required and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Feb 24, 2017
sourcing the file with `zsh` > 4 resulted in an `unknown file attribute`.
More details at http://stackoverflow.com/questions/37220495/zsh-unknown-file-attribute

replacing $@ with $* for get_comp_words
as suggested by @sttts worked to resolve the issue
@elipapa elipapa force-pushed the zsh-completions-fix branch from 72586c7 to 136c90a Compare February 24, 2017 16:32
@elipapa
Copy link
Contributor Author

elipapa commented Feb 24, 2017

@sttts squashed. unsure on what i should do for the next step. any pointers?

@sttts sttts added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 24, 2017
@sttts
Copy link
Contributor

sttts commented Feb 24, 2017

@elipapa this PR will go into the submit queue now. So with some luck it's merged in an hour.

@sttts
Copy link
Contributor

sttts commented Feb 24, 2017

And thanks for the fix 👍

@elipapa
Copy link
Contributor Author

elipapa commented Feb 24, 2017

@sttts the fix was yours! i just found the problem

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 7a8c467 into kubernetes:master Feb 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants