Skip to content

Commit

Permalink
Complete cargo check bin targets like build (#10499)
Browse files Browse the repository at this point in the history
Since `check` operates on basically the same things as `build`, it makes
sense to complete binary targets the same way (i.e. tests, bins, examples)
  • Loading branch information
ian-h-chamberlain committed May 17, 2024
1 parent 0271d91 commit 1462da3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions share/completions/cargo.fish
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ set -la __fish_cargo_subcommands (complete -C'cargo-' | string replace -rf '^car
complete -c cargo -f -c cargo -n __fish_use_subcommand -a "$__fish_cargo_subcommands"
complete -c cargo -x -c cargo -n '__fish_seen_subcommand_from help' -a "$__fish_cargo_subcommands"

for x in bench b build rustc t test
for x in bench b build c check rustc t test
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l bench -a "(cargo bench --bench 2>&1 | string replace -rf '^\s+' '')"
complete -c cargo -n "__fish_seen_subcommand_from $x" -l lib -d 'Only this package\'s library'
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l test -a "(cargo test --test 2>&1 | string replace -rf '^\s+' '')"
end

for x in bench b build r run rustc t test
for x in bench b build c check r run rustc t test
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l bin -a "(cargo run --bin 2>&1 | string replace -rf '^\s+' '')"
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l example -a "(cargo run --example 2>&1 | string replace -rf '^\s+' '')"
end
Expand Down

0 comments on commit 1462da3

Please sign in to comment.