-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
clap_generate an incorrect autocomplete zsh script #2479
Comments
It might be a zsh version issue. |
Perhaps. I'm running |
#compdef pouf and not #compdef _pouf pouf
I've report a specific commit. (and the solution in the other hand) |
Could you share how you're sourcing the completion script? I'm using clap v3 completions in zoxide, and they're working fine on zsh. See my completions file here. AFAIK, a completion script is sourced by adding the containing folder to fpath=("$HOME/ws/zoxide/contrib/completions" "${fpath[@]}") |
Like I say on first comment, I used : source "$HOME_pouf fpath doesn't work... I guess beacuse error isn't show. |
Have you called autoload -Uz compinit && compinit I don't think you're supposed to |
Hum, right : my autoload is called before my fpath. |
Agreed, that's why I created #2488. |
Please complete the following tasks
Rust Version
rustc 1.53.0-nightly
Clap Version
master
Minimal reproducible code
Hi, I tried to generate on my little project https://github.com/mothsART/pouf autocompletion on zsh.
Cargo build produce this file :
https://github.com/mothsART/pouf/blob/8335f28d5ea9c6a3916a3d5098481e3aaab9f45d/_pouf
and I included with :
source _pouf
This produce an error like :
If i manualy delete
_pouf "$@"
, everything seems correct.Same issue with 2 opposite version of Zsh :
Zsh 5.1 and 5.8 (the last one).
Finally, the script suggest me
but it doesn't work.
I replace it with :
Steps to reproduce the bug with the above code
cargo build
Actual Behaviour
https://github.com/mothsART/pouf/blob/8335f28d5ea9c6a3916a3d5098481e3aaab9f45d/_pouf
Expected Behaviour
https://github.com/mothsART/pouf/blob/7e464e21f0a46795c83026511980f7c18de27dbb/_pouf
Additional Context
No response
Debug Output
No response
The text was updated successfully, but these errors were encountered: