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

zsh completion instructions incorrect, maybe #1393

Closed
xxxserxxx opened this issue Mar 17, 2023 · 2 comments
Closed

zsh completion instructions incorrect, maybe #1393

xxxserxxx opened this issue Mar 17, 2023 · 2 comments

Comments

@xxxserxxx
Copy link

I think maybe the README instructions didn't get updated for a recent change -- or else the completion output changed unexpectedly.

The README says to strip the last line of jj support completion --zsh with sed, but that now removes the closing fi of the last if statement:

$ jj support completion --zsh | tail -n 5
if [ "$funcstack[1]" = "_jj" ]; then
    _jj "$@"
else
    compdef _jj jj
fi
@martinvonz
Copy link
Member

Yes, it look like that changed in clap-rs/clap@0f3e729, which was released in clap-complete 4.1.4, so you won't technically run into that problem if you follow our installation instructions and pass --locked to cargo install since we depend on 4.0.7. I'll leave this bug open until we have upgraded to the new version of clap-complete and updated the documentation.

FYI, this seems to work for me with the new version:

autoload -U compinit
compinit
source <(jj support completion --zsh)

martinvonz added a commit that referenced this issue Mar 17, 2023
We need 1.64 to bump `clap` to `4.1`. We don't really need to upgrade
to that, but being on an older version causes minor confusions like
#1393. Rust 1.64 is very close to 6 months old at this point.
martinvonz added a commit that referenced this issue Mar 17, 2023
This includes some changes to error messages. Also, the Zsh shell
completion script is now simpler to source.

Fixes #1393.
martinvonz added a commit that referenced this issue Mar 17, 2023
We need 1.64 to bump `clap` to `4.1`. We don't really need to upgrade
to that, but being on an older version causes minor confusions like
#1393. Rust 1.64 is very close to 6 months old at this point.
martinvonz added a commit that referenced this issue Mar 17, 2023
This includes some changes to error messages. Also, the Zsh shell
completion script is now simpler to source.

Fixes #1393.
martinvonz added a commit that referenced this issue Mar 18, 2023
We need 1.64 to bump `clap` to `4.1`. We don't really need to upgrade
to that, but being on an older version causes minor confusions like
#1393. Rust 1.64 is very close to 6 months old at this point.
martinvonz added a commit that referenced this issue Mar 18, 2023
This includes some changes to error messages. Also, the Zsh shell
completion script is now simpler to source.

Fixes #1393.
martinvonz added a commit that referenced this issue Mar 18, 2023
We need 1.64 to bump `clap` to `4.1`. We don't really need to upgrade
to that, but being on an older version causes minor confusions like
#1393. Rust 1.64 is very close to 6 months old at this point.
@xxxserxxx
Copy link
Author

Yup! The completion seemed fine, it was just the README instruction was missed. Thanks

listx added a commit to listx/jj that referenced this issue Jul 22, 2023
We upgraded to clap 4.1 in 8f1dc49 (cargo: upgrade to clap 4.1,
2023-03-17), and the pipe to `sed` was removed in the README.md file in
that same commit. However the documentation was not updated in mod.rs,
which leads us to give the obsolete (now incorrect) advice when we run
`jj util completion --help`.

See jj-vcs#1393.
@listx listx mentioned this issue Jul 22, 2023
4 tasks
listx added a commit that referenced this issue Jul 23, 2023
We upgraded to clap 4.1 in 8f1dc49 (cargo: upgrade to clap 4.1,
2023-03-17), and the pipe to `sed` was removed in the README.md file in
that same commit. However the documentation was not updated in mod.rs,
which leads us to give the obsolete (now incorrect) advice when we run
`jj util completion --help`.

See #1393.
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