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

Error when loading completion from zsh #7

Closed
kbd opened this issue Apr 9, 2018 · 2 comments
Closed

Error when loading completion from zsh #7

kbd opened this issue Apr 9, 2018 · 2 comments

Comments

@kbd
Copy link
Contributor

kbd commented Apr 9, 2018

Under zsh, you run the following code:

if [[ "$(basename ${(%):-%x})" != "..." ]]; then

Under a login shell, the shell executable begins with a dash (eg. '-zsh'), so basename fails with:

$ eval "$(pipenv --completion)"
basename: illegal option -- z
usage: basename string [suffix]
       basename [-a] [-s suffix] string [...]

(pipenv uses click_completion internally.) To fix this, you can do:

basename -- ${(%):-%x}

Adding -- stops anything starting with - from being parsed as an argument.

@glehmann
Copy link
Collaborator

looks good to me.
Could you submit a pull request with that fix?

@glehmann
Copy link
Collaborator

fixed in #10

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

No branches or pull requests

2 participants