summaryrefslogtreecommitdiff
path: root/plugins/cargo/_cargo
diff options
context:
space:
mode:
authorBen Goldberg <ben@benaaron.dev>2021-05-03 10:59:45 -0400
committerGitHub <noreply@github.com>2021-05-03 16:59:45 +0200
commit4e8ffe88d4311edcd084de5efd4ee6688e9e70f7 (patch)
treea44b08e0fc3a1ad255d71de7e9d89e785f5a6fa6 /plugins/cargo/_cargo
parentf4de8c5b3a977d67ecbd302f24463dc00667eb40 (diff)
downloadzsh-4e8ffe88d4311edcd084de5efd4ee6688e9e70f7.tar.gz
zsh-4e8ffe88d4311edcd084de5efd4ee6688e9e70f7.tar.bz2
zsh-4e8ffe88d4311edcd084de5efd4ee6688e9e70f7.zip
fix(cargo): complete flags for default cargo aliases (#9692)
By default, cargo provides alias for some commonly used functions. This patch makes it that those alias will complete the same as their full commands. Default alias: b -> build c -> check t -> test r -> run Since cargo allows users to define custom alias it would be nice if oh-my-zsh automatically detected those and preformed completions as such but that would be a much more complex patch.
Diffstat (limited to 'plugins/cargo/_cargo')
-rw-r--r--plugins/cargo/_cargo8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/cargo/_cargo b/plugins/cargo/_cargo
index ffc9fcdc8..ebff99310 100644
--- a/plugins/cargo/_cargo
+++ b/plugins/cargo/_cargo
@@ -77,7 +77,7 @@ _cargo() {
'*:args:_default'
;;
- build)
+ build|b)
_arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \
'--all-targets[equivalent to specifying --lib --bins --tests --benches --examples]' \
"${command_scope_spec[@]}" \
@@ -86,7 +86,7 @@ _cargo() {
'--build-plan[output the build plan in JSON]' \
;;
- check)
+ check|c)
_arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \
'--all-targets[equivalent to specifying --lib --bins --tests --benches --examples]' \
"${command_scope_spec[@]}" \
@@ -224,7 +224,7 @@ _cargo() {
_arguments -s -S $common $manifest
;;
- run)
+ run|r)
_arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \
'--example=[name of the bin target]:name' \
'--bin=[name of the bin target]:name' \
@@ -259,7 +259,7 @@ _cargo() {
'*: :_guard "^-*" "query"'
;;
- test)
+ test|t)
_arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \
'--test=[test name]: :_cargo_test_names' \
'--no-fail-fast[run all tests regardless of failure]' \