feat: vcs, color, and message format native completion by nooma-42 · Pull Request #15322 · rust-lang/cargo (original) (raw)
What does this PR try to resolve?
Related to #14520
This PR introduces auto-completion for following options:
--color
option with values: auto, always, never--vcs
option with values: git, hg, pijul, fossil, none--message-format
option with values: human, short, json, json-diagnostic-short, json-diagnostic-rendered
Take --color
as an example, when a user types cargo build --color <TAB>
the system will automatically suggest auto, always, never
How should we test and review this PR?
To verify this feature, follow these steps:
- In the terminal, type
cargo build --color <TAB>
orcargo new my_project --vcs <TAB>
orcargo check --message-format <TAB>
- Press the TAB key.
- You should see option suggestions 2025-03-18.4.29.14.mov