Skip to content

Commit dfbf3e6

Browse files
committed
Add completions for cargo remove
1 parent 882c5dd commit dfbf3e6

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/etc/_cargo

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,17 @@ _cargo() {
241241
_arguments -s -S $common $manifest
242242
;;
243243

244+
remove | rm)
245+
_arguments -s -A "^--" $common $manifest \
246+
"--dev[remove as a dev dependency]" \
247+
"--build[remove as a build dependency]" \
248+
"--target=[remove as a dependency from the given target platform]" \
249+
"--dry-run[don't actually write the manifest]" \
250+
'(-p --package)'{-p+,--package=}'[package to remove from]:package:_cargo_package_names' \
251+
'1: :_guard "^-*" "crate name"' \
252+
'*:args:_default'
253+
;;
254+
244255
run | r)
245256
_arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \
246257
'--example=[name of the bin target]:name:_cargo_example_names' \

src/etc/cargo.bashcomp.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ _cargo()
7373
local opt__pkgid="$opt_common $opt_mani $opt_lock $opt_pkg"
7474
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"
7575
local opt__read_manifest="$opt_help $opt_quiet $opt_verbose $opt_mani $opt_color $opt_lock --no-deps"
76+
local opt__remove="$opt_common $opt_pkg $opt_lock $opt_mani --dry-run --dev --build --target"
77+
local opt__rm="$opt__remove"
7678
local opt__report="$opt_help $opt_verbose $opt_color future-incompat future-incompatibilities"
7779
local opt__report__future_incompat="$opt_help $opt_verbose $opt_color $opt_pkg --id"
7880
local opt__run="$opt_common $opt_pkg $opt_feat $opt_mani $opt_lock $opt_parallel --message-format --target --bin --example --release --target-dir --profile"

0 commit comments

Comments
 (0)