From 1462da3ae2d361f8c2754e9c3fe5c88bde2fb3cf Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Fri, 17 May 2024 13:31:30 -0400 Subject: [PATCH] Complete `cargo check` bin targets like `build` (#10499) 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) --- share/completions/cargo.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/completions/cargo.fish b/share/completions/cargo.fish index ce80b94e1..3e0927cfb 100644 --- a/share/completions/cargo.fish +++ b/share/completions/cargo.fish @@ -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