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:

  1. --color option with values: auto, always, never
  2. --vcs option with values: git, hg, pijul, fossil, none
  3. --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:

  1. In the terminal, type cargo build --color <TAB> or cargo new my_project --vcs <TAB> or cargo check --message-format <TAB>
  2. Press the TAB key.
  3. You should see option suggestions 2025-03-18.4.29.14.mov