Commit a8ed44c 1 parent 0806953 commit a8ed44c Copy full SHA for a8ed44c
File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 3
3
typeset -A opt_args
4
4
autoload -U regexp-replace
5
5
6
+ zstyle -T ':completion:*:*:cargo:*' tag-order && \
7
+ zstyle ':completion:*:*:cargo:*' tag-order 'common-commands'
8
+
6
9
_cargo() {
7
10
8
11
_arguments \
@@ -11,10 +14,14 @@ _arguments \
11
14
'(- 1 *)'{-v,--verbose}'[use verbose output]' \
12
15
'(- 1 *)'--color'[colorization option]' \
13
16
'(- 1 *)'{-V,--version}'[show version information]' \
14
- '1: :_cargo_cmds ' \
17
+ '1: :->command ' \
15
18
'*:: :->args'
16
19
17
20
case $state in
21
+ command)
22
+ _alternative 'common-commands:common:_cargo_cmds' 'all-commands:all:_cargo_all_cmds'
23
+ ;;
24
+
18
25
args)
19
26
case $words[1] in
20
27
bench)
@@ -431,8 +438,12 @@ local -a commands;commands=(
431
438
'version:show version information'
432
439
'yank:remove pushed file from index'
433
440
)
434
- _describe 'command' commands
441
+ _describe -t common-commands 'common commands' commands
442
+ }
435
443
444
+ _cargo_all_cmds(){
445
+ local -a commands;commands=($(cargo --list))
446
+ _describe -t all-commands 'all commands' commands
436
447
}
437
448
438
449
You can’t perform that action at this time.
0 commit comments