Skip to content

Commit

Permalink
Auto merge of #10295 - ehuss:bash-report, r=alexcrichton
Browse files Browse the repository at this point in the history
Add report subcommand to bash completion.

This adds the `cargo report` subcommand to the bash completion.
  • Loading branch information
bors committed Jan 18, 2022
2 parents 03e24bc + 56e5b39 commit c2950c8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/etc/cargo.bashcomp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ _cargo()
local opt__pkgid="$opt_common $opt_mani $opt_lock $opt_pkg"
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"
local opt__read_manifest="$opt_help $opt_quiet $opt_verbose $opt_mani $opt_color $opt_lock --no-deps"
local opt__report="$opt_help $opt_verbose $opt_color future-incompat future-incompatibilities"
local opt__report__future_incompat="$opt_help $opt_verbose $opt_color $opt_pkg --id"
local opt__run="$opt_common $opt_pkg $opt_feat $opt_mani $opt_lock $opt_jobs --message-format --target --bin --example --release --target-dir --profile"
local opt__r="$opt__run"
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"
Expand Down Expand Up @@ -140,7 +142,11 @@ _cargo()
COMPREPLY=( $( compgen -W "$__cargo_commands" -- "$cur" ) )
;;
*)
local opt_var=opt__${cmd//-/_}
if [[ "$cmd" == "report" && "$prev" == future-incompat* ]]; then
local opt_var=opt__${cmd//-/_}__${prev//-/_}
else
local opt_var=opt__${cmd//-/_}
fi
if [[ -z "${!opt_var}" ]]; then
# Fallback to filename completion.
_filedir
Expand Down

0 comments on commit c2950c8

Please sign in to comment.