From dfbf3e6e77314a52e84d915e3c3082a603fa5cee Mon Sep 17 00:00:00 2001 From: Cassaundra Smith Date: Mon, 19 Sep 2022 13:15:24 -0700 Subject: [PATCH] Add completions for `cargo remove` --- src/etc/_cargo | 11 +++++++++++ src/etc/cargo.bashcomp.sh | 2 ++ 2 files changed, 13 insertions(+) diff --git a/src/etc/_cargo b/src/etc/_cargo index 5b0f881f66b5..df74c53a18f4 100644 --- a/src/etc/_cargo +++ b/src/etc/_cargo @@ -241,6 +241,17 @@ _cargo() { _arguments -s -S $common $manifest ;; + remove | rm) + _arguments -s -A "^--" $common $manifest \ + "--dev[remove as a dev dependency]" \ + "--build[remove as a build dependency]" \ + "--target=[remove as a dependency from the given target platform]" \ + "--dry-run[don't actually write the manifest]" \ + '(-p --package)'{-p+,--package=}'[package to remove from]:package:_cargo_package_names' \ + '1: :_guard "^-*" "crate name"' \ + '*:args:_default' + ;; + run | r) _arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \ '--example=[name of the bin target]:name:_cargo_example_names' \ diff --git a/src/etc/cargo.bashcomp.sh b/src/etc/cargo.bashcomp.sh index 3b305e24681c..539299f0e06d 100644 --- a/src/etc/cargo.bashcomp.sh +++ b/src/etc/cargo.bashcomp.sh @@ -73,6 +73,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_parallel --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__remove="$opt_common $opt_pkg $opt_lock $opt_mani --dry-run --dev --build --target" + local opt__rm="$opt__remove" 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_parallel --message-format --target --bin --example --release --target-dir --profile"