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 +- 3 files changed, 9 insertions(+), 6 deletions(-) (limited to 'Completion/Zsh/Command') 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' \ -- cgit 1.4.1