Repository navigation
Duplicative auto completions #3156
Description
Activity
- changed the title
[-]Duplicate auto completions[/-][+]Duplicative auto completions[/+]on Jan 14, 2023 This is probably some clap interaction.
This is also an issue for me but it doesn't occur with Cargo completions. Something specifically about Rustup completions must have gone wrong.
EDIT: see more minimal
ContainerfilebelowStill happens, can easily reproduce with the following:cd $(mktemp -d) cat << EOF > Containerfile FROM alpine RUN apk add --no-cache zsh curl RUN zsh -c "curl https://sh.rustup.rs -sSf | sh -s -- -y" RUN mkdir ~/.zfunc RUN ~/.cargo/bin/rustup completions zsh > ~/.zfunc/_rustup RUN echo 'export PATH="/root/.cargo/bin/:\$PATH"' > ~/.zshrc RUN echo 'fpath+=~/.zfunc' >> ~/.zshrc RUN echo 'autoload -Uz compinit' >> ~/.zshrc RUN echo 'compinit' >> ~/.zshrc ENTRYPOINT /bin/zsh EOF podman build . --iidfile rustupid podman run -it $(cat rustupid)
Reacted by rami3l@omertuc I can reproduce this on d288805 with the following Dockerfile:
FROM rust:alpine RUN apk add --no-cache zsh curl ADD _rustup /root/.zfunc/ RUN echo 'export PATH="/root/.cargo/bin/:$PATH"' > ~/.zshrc RUN echo 'fpath+=~/.zfunc' >> ~/.zshrc RUN echo 'autoload -Uz compinit' >> ~/.zshrc RUN echo 'compinit' >> ~/.zshrc ENTRYPOINT /bin/zsh
@samchouse Thanks for your insight. This seems to have something to do with the
+toolchainsyntax. Clap does not know the difference betweenrustup +completions completionsandrustup completions completions(the rejection logic is implemented manually), so it will happily suggest the latter.Reacted by Omer TuchfeldUnfortunately, given the analysis above in #3156 (comment), I'm afraid there's not much we can do about this situation.
Would something like this help in the future?
Reacted by rami3lClosing in favor of #2268.
Problem
Duplicative auto completions
Steps
Possible Solution(s)
No response
Notes
No response
Rustup version
Installed toolchains