mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-21 00:01:26 +01:00
23783: use _path_commands.
This commit is contained in:
parent
4e945291a2
commit
53184f457b
6 changed files with 16 additions and 10 deletions
|
@ -1,5 +1,10 @@
|
|||
2007-08-19 Clint Adams <clint@zsh.org>
|
||||
|
||||
* R.Ramkumar: 23783: Completion/Zsh/Command/_command,
|
||||
Completion/Zsh/Command/_hash, Completion/Zsh/Command/_which,
|
||||
Completion/Zsh/Context/_equal, Completion/Zsh/Type/_command_names:
|
||||
use _path_commands.
|
||||
|
||||
* R.Ramkumar, tweaked: 23782: Completion/Unix/Type/_path_commands:
|
||||
commands with descriptions.
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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' \
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#compdef -equal-
|
||||
|
||||
local expl
|
||||
|
||||
_wanted commands expl command compadd -k commands
|
||||
_path_commands
|
||||
|
|
|
@ -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 = */* ]] &&
|
||||
|
|
Loading…
Reference in a new issue