Commit 11966a4
committed
Auto merge of #12606 - Angelin01:tab-completion-rustup-fallback-rustc, r=weihanglo
Tab completion for --target uses rustup but fallsback to rustc
### What does this PR try to resolve?
Fixes #12585
Currently, not only is the tab completion for `--target` inconsistent between bash and zsh, it depends on rustup and rustc respectively.
As discussed in the issue at hand, we'll use `rustup` if it is available and fallback to `rustc` if it is not, even if it is unfriendly.
### How should we test and review this PR?
Source the respective completion functions and test it out with `cargo build --target [TAB]`.
**I would appreciate if someone that regularly uses zsh would test this.** I did basic testing, but since I don't use zsh commonly I am unsure if everything is as it should be.
### Additional information
I switched to using `rustup target list --installed` instead of grabbing lines that contain "default" or "installed". I believe that any "default" target should be installed too, right?2 files changed
Lines changed: 14 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
411 | | - | |
412 | | - | |
413 | | - | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
414 | 420 | | |
415 | 421 | | |
416 | 422 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
262 | 258 | | |
263 | 259 | | |
264 | 260 | | |
| |||
0 commit comments