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(complete): Strip wrappers for running completer #5733

Merged
merged 2 commits into from
Sep 17, 2024
Merged

Conversation

epage
Copy link
Member

@epage epage commented Sep 17, 2024

My hope is this will make the source <(CARGO_COMPLETE=bash cargo +nightly) case work while providing a workaround for anyone who this doesn't work for.

@epage epage merged commit 6ac1535 into clap-rs:master Sep 17, 2024
23 checks passed
@epage epage deleted the bin branch September 17, 2024 21:10
epage added a commit to epage/cargo that referenced this pull request Sep 17, 2024
This pulls in
- clap-rs/clap#5731 for `IFS` oddities I had
- clap-rs/clap#5733 with the hope that this makes `CARGO_COMPLETE_BASH cargo +nightly` just work

`clap` was completed next to `clap_complete` because `clap_complete`
depends on unstable features from `clap`.
None should have changed in this time window but I wanted to exercise
caution.
bors added a commit to rust-lang/cargo that referenced this pull request Sep 18, 2024
fix(complete): Fix problems on my machine

### What does this PR try to resolve?
This pulls in
- clap-rs/clap#5731 for `IFS` oddities I had
- clap-rs/clap#5733 with the hope that this makes `CARGO_COMPLETE_BASH cargo +nightly` just work

### How should we test and review this PR?

### Additional information

`clap` was completed next to `clap_complete` because `clap_complete` depends on unstable features from `clap`.
None should have changed in this time window but I wanted to exercise caution.
epage added a commit to epage/cargo that referenced this pull request Sep 18, 2024
clap-rs/clap#5733 removed the rustup proxy so that
`CARGO_COMPLETE=bash cargo +nightly` works
(with a side benefit of removing the proxy overhead).

As a downside, cargo no longer knows it is running within rustup, so we
aren't reading `--target` candidates from rustup.

This changes the code to always try rustup.  It is likely a good enough
source, even if the user isn't currently using it.
The candidates should be about the same, just rustup hides some by
default.
Hiding just means it isn't shown by default but if only hidden
candidates match, then we show them.
epage added a commit to epage/cargo that referenced this pull request Sep 19, 2024
clap-rs/clap#5733 removed the rustup proxy so that
`CARGO_COMPLETE=bash cargo +nightly` works
(with a side benefit of removing the proxy overhead).

As a downside, cargo no longer knows it is running within rustup, so we
aren't reading `--target` candidates from rustup.

This changes the code to always try rustup.  It is likely a good enough
source, even if the user isn't currently using it.
The candidates should be about the same, just rustup hides some by
default.
Hiding just means it isn't shown by default but if only hidden
candidates match, then we show them.
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

Successfully merging this pull request may close these issues.

1 participant