Commit bffbb60
authored
feat(cli): Add support for completing
### What does this PR try to resolve?
Currently, `cargo.bashcomp.sh` doesn't support completing the `--config`
flag, let alone its value. This PR adds support for completing both the
`--config` flag and a `_filedir` value for it. This support includes
both cases where it appears before the cargo subcommand, and cases where
it appears after. In the process of implementing the former, I also
added support for completing values for `--color` before the cargo
subcommand. Currently, completing values for `--color` is only supported
after the cargo subcommand.
### How to test and review this PR?
In a Bash shell, run:
```
source src/etc/cargo.bashcomp.sh
```
Then, observe that the following completions behave as expected:
```
cargo --co<tab>
cargo --config <tab>
cargo --color <tab>
cargo build --co<tab>
cargo build --config <tab>
```--config values in Bash (#16245)1 file changed
+5
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
146 | 150 | | |
147 | 151 | | |
148 | 152 | | |
| |||
0 commit comments