diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-04-11 07:57:56 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-04-11 07:57:56 +0000 |
commit | fac3086d9782e73dcaf1aa65fd36a0b63a374719 (patch) | |
tree | 7bab35e2787ca17f02ec932dffae1bfff2ffcfe3 /Completion/Builtins/_hash | |
parent | 37012f06a7e5e8a64614dbf9032c77cff1bcfcfb (diff) | |
download | zsh-fac3086d9782e73dcaf1aa65fd36a0b63a374719.tar.gz zsh-fac3086d9782e73dcaf1aa65fd36a0b63a374719.tar.xz zsh-fac3086d9782e73dcaf1aa65fd36a0b63a374719.zip |
_wanted now tests both tags and labels; change places where _wanted was called without a command; allow multiple patterns per string in file-patterns; update _next_tags to work with labels (10632)
Diffstat (limited to 'Completion/Builtins/_hash')
-rw-r--r-- | Completion/Builtins/_hash | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/Completion/Builtins/_hash b/Completion/Builtins/_hash index 171c5e2e8..c577fc4d7 100644 --- a/Completion/Builtins/_hash +++ b/Completion/Builtins/_hash @@ -1,13 +1,16 @@ -#defcomp hash +#compdef hash -if [[ -mword 1 -*d* ]]; then - if [[ -string 1 '=' ]]; then - _path_files -g '*(-/)' +local expl + +if [[ "$words[2]" = -*d* ]]; then + if compset -P 1 '*='; then + _wanted -C -d-value files expl directories _path_files -/ else - complist -n -q -S '=' + _wanted -C -d named-directories expl 'named directory' \ + compadd -q -S '=' - "${(@k)nameddirs}" fi -elif [[ -string 1 '=' ]]; then - _files -/g '*(*)' +elif compset -P 1 '*='; then + _wanted -C value values expl 'executable file' _files "$expl[@]" -g '*(-*)' else - complist -m -q -S '=' + _wanted -C name commands expl command compadd -q -S '=' - "${(@k)commands}" fi |