diff options
Diffstat (limited to 'Completion/Zsh/Command')
-rw-r--r-- | Completion/Zsh/Command/_command | 10 | ||||
-rw-r--r-- | Completion/Zsh/Command/_hash | 3 | ||||
-rw-r--r-- | Completion/Zsh/Command/_which | 2 |
3 files changed, 9 insertions, 6 deletions
diff --git a/Completion/Zsh/Command/_command b/Completion/Zsh/Command/_command index b90ec933e..72d7b6e99 100644 --- a/Completion/Zsh/Command/_command +++ b/Completion/Zsh/Command/_command @@ -1,10 +1,12 @@ #compdef command +local ret + if [[ CURRENT -ge 3 ]]; then compset -n 2 - _normal + _normal && ret=0 else - local expl - - _wanted commands expl 'external command' compadd "$@" -k commands + _path_commands "$@" && ret=0 fi + +return ret diff --git a/Completion/Zsh/Command/_hash b/Completion/Zsh/Command/_hash index 80c136118..d4bb59d28 100644 --- a/Completion/Zsh/Command/_hash +++ b/Completion/Zsh/Command/_hash @@ -33,7 +33,8 @@ if [[ $state = hashval ]]; then elif compset -P 1 '*='; then _wanted -C value values expl 'executable file' _files -g '*(-*)' && ret=0 else - _wanted -C name commands expl command compadd -q -S '=' -k commands && ret=0 + curcontext="${curcontext%:*}:name" + _path_commands -q -S '=' && ret=0 fi fi diff --git a/Completion/Zsh/Command/_which b/Completion/Zsh/Command/_which index 2b89112bc..07ede39fd 100644 --- a/Completion/Zsh/Command/_which +++ b/Completion/Zsh/Command/_which @@ -28,7 +28,7 @@ if [[ "$state" = command ]]; then args=( "$@" ) _alternative -O args \ - 'commands:external command:compadd -k commands' \ + 'commands:external command:_path_commands' \ 'builtins:builtin command:compadd -k builtins' \ 'functions:shell function:compadd -k functions' \ 'aliases:alias:compadd -k aliases' \ |