File tree 2 files changed +21
-0
lines changed
2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,26 @@ _cargo() {
66
66
args)
67
67
curcontext="${curcontext%:*}-${words[1]}:"
68
68
case ${words[1]} in
69
+ add)
70
+ _arguments -s -A "^--" $common $manifest $registry \
71
+ {-F+,--features=}'[specify features to activate]:feature'
72
+ "--default-features[enable the default features]"
73
+ "--no-default-features[don't enable the default features]"
74
+ "--optional[mark the dependency as optional]"
75
+ "--no-optional[mark the dependency as required]"
76
+ "--dev[add as a dev dependency]"
77
+ "--build[add as a build dependency]"
78
+ "--target=[add as a dependency to the given target platform]"
79
+ "--rename=[rename the dependency]"
80
+ "--dry-run[don't actually write the manifest]"
81
+ '--branch=[branch to use when adding from git]:branch' \
82
+ '--git=[specify URL from which to add the crate]:url:_urls' \
83
+ '--path=[local filesystem path to crate to add]: :_directories' \
84
+ '--rev=[specific commit to use when adding from git]:commit' \
85
+ '--tag=[tag to use when adding from git]:tag' \
86
+ '1: :_guard "^-*" "crate name"' \
87
+ '*:args:_default'
88
+ ;;
69
89
bench)
70
90
_arguments -s -A "^--" $common $parallel $features $msgfmt $triple $target $manifest \
71
91
"${command_scope_spec[@]}" \
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ _cargo()
48
48
local opt_targets=" --lib --bin --bins --example --examples --test --tests --bench --benches --all-targets"
49
49
50
50
local opt___nocmd=" $opt_common -V --version --list --explain"
51
+ local opt__add=" $opt_common -p --package --features --default-features --no-default-features $opt_mani --optional --no-optional --rename --dry-run --path --git --branch --tag --rev --registry --dev --build --target"
51
52
local opt__bench=" $opt_common $opt_pkg_spec $opt_feat $opt_mani $opt_lock $opt_parallel $opt_targets --message-format --target --no-run --no-fail-fast --target-dir"
52
53
local opt__build=" $opt_common $opt_pkg_spec $opt_feat $opt_mani $opt_lock $opt_parallel $opt_targets --message-format --target --release --profile --target-dir"
53
54
local opt__b=" $opt__build "
You can’t perform that action at this time.
0 commit comments