Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add report subcommand to bash completion. #10295

Merged
merged 1 commit into from
Jan 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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