Skip to content

Commit c2950c8

Browse files
committed
Auto merge of #10295 - ehuss:bash-report, r=alexcrichton
Add report subcommand to bash completion. This adds the `cargo report` subcommand to the bash completion.
2 parents 03e24bc + 56e5b39 commit c2950c8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/etc/cargo.bashcomp.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ _cargo()
7171
local opt__pkgid="$opt_common $opt_mani $opt_lock $opt_pkg"
7272
local opt__publish="$opt_common $opt_mani $opt_feat $opt_lock $opt_jobs --allow-dirty --dry-run --token --no-verify --index --registry --target --target-dir"
7373
local opt__read_manifest="$opt_help $opt_quiet $opt_verbose $opt_mani $opt_color $opt_lock --no-deps"
74+
local opt__report="$opt_help $opt_verbose $opt_color future-incompat future-incompatibilities"
75+
local opt__report__future_incompat="$opt_help $opt_verbose $opt_color $opt_pkg --id"
7476
local opt__run="$opt_common $opt_pkg $opt_feat $opt_mani $opt_lock $opt_jobs --message-format --target --bin --example --release --target-dir --profile"
7577
local opt__r="$opt__run"
7678
local opt__rustc="$opt_common $opt_pkg $opt_feat $opt_mani $opt_lock $opt_jobs $opt_targets -L --crate-type --extern --message-format --profile --target --release --target-dir"
@@ -140,7 +142,11 @@ _cargo()
140142
COMPREPLY=( $( compgen -W "$__cargo_commands" -- "$cur" ) )
141143
;;
142144
*)
143-
local opt_var=opt__${cmd//-/_}
145+
if [[ "$cmd" == "report" && "$prev" == future-incompat* ]]; then
146+
local opt_var=opt__${cmd//-/_}__${prev//-/_}
147+
else
148+
local opt_var=opt__${cmd//-/_}
149+
fi
144150
if [[ -z "${!opt_var}" ]]; then
145151
# Fallback to filename completion.
146152
_filedir

0 commit comments

Comments
 (0)