From 53184f457bb560ede7a44729f43778a7d3078b2b Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Sun, 19 Aug 2007 23:31:30 +0000 Subject: 23783: use _path_commands. --- Completion/Zsh/Command/_command | 10 ++++++---- Completion/Zsh/Command/_hash | 3 ++- Completion/Zsh/Command/_which | 2 +- Completion/Zsh/Context/_equal | 4 +--- Completion/Zsh/Type/_command_names | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) (limited to 'Completion') 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' \ diff --git a/Completion/Zsh/Context/_equal b/Completion/Zsh/Context/_equal index a1577d62c..58a415d56 100644 --- a/Completion/Zsh/Context/_equal +++ b/Completion/Zsh/Context/_equal @@ -1,5 +1,3 @@ #compdef -equal- -local expl - -_wanted commands expl command compadd -k commands +_path_commands diff --git a/Completion/Zsh/Type/_command_names b/Completion/Zsh/Type/_command_names index 85ca3b912..f57d05226 100644 --- a/Completion/Zsh/Type/_command_names +++ b/Completion/Zsh/Type/_command_names @@ -9,7 +9,7 @@ local args defs zstyle -t ":completion:${curcontext}:commands" rehash && rehash defs=( - 'commands:external command:compadd -k commands' + 'commands:external command:_path_commands' ) [[ -n "$path[(r).]" || $PREFIX = */* ]] && -- cgit 1.4.1