diff options
author | Oliver Kiddle <opk@users.sourceforge.net> | 2003-07-02 10:25:05 +0000 |
---|---|---|
committer | Oliver Kiddle <opk@users.sourceforge.net> | 2003-07-02 10:25:05 +0000 |
commit | 1cb11615aa337d98022a48c1c3c8c5c33b0b57c2 (patch) | |
tree | 666f075271d340fabcc63b564e1c296aa3715f9e /Completion/Zsh/Command/_which | |
parent | bedc4995d225195a2e48c0d9430ceb97adfb7e2f (diff) | |
download | zsh-1cb11615aa337d98022a48c1c3c8c5c33b0b57c2.tar.gz zsh-1cb11615aa337d98022a48c1c3c8c5c33b0b57c2.tar.xz zsh-1cb11615aa337d98022a48c1c3c8c5c33b0b57c2.zip |
merge changes back from 4.1
Diffstat (limited to 'Completion/Zsh/Command/_which')
-rw-r--r-- | Completion/Zsh/Command/_which | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Completion/Zsh/Command/_which b/Completion/Zsh/Command/_which new file mode 100644 index 000000000..2b89112bc --- /dev/null +++ b/Completion/Zsh/Command/_which @@ -0,0 +1,39 @@ +#compdef which whence where type + +local farg aarg cargs args state line curcontext="$curcontext" ret=1 + +cargs=( \ + '(-v -c)-w[print command type]' \ + '-p[always do a path search]' \ + '-m[treat the arguments as patterns]' \ + '-s[print symlink free path as well]' \ + '*:commands:->command' ) +farg='-f[output contents of functions]' +aarg='-a[print all occurrences in path]' + +case ${service} in + whence) + _arguments -C -s -A "-*" -S \ + '(-c -w)-v[verbose output]' \ + '(-v -w)-c[csh-like output]' \ + "${cargs[@]}" "$farg" "$aarg" && ret=0 + ;; + where) _arguments -C -s -A "-*" -S "${cargs[@]}" && ret=0;; + which) _arguments -C -s -A "-*" -S "${cargs[@]}" "$aarg" && ret=0;; + type) _arguments -C -s -A "-*" -S "${cargs[@]}" "$aarg" "$farg" && ret=0;; +esac + +if [[ "$state" = command ]]; then + + args=( "$@" ) + + _alternative -O args \ + 'commands:external command:compadd -k commands' \ + 'builtins:builtin command:compadd -k builtins' \ + 'functions:shell function:compadd -k functions' \ + 'aliases:alias:compadd -k aliases' \ + 'reserved-words:reserved word:compadd -k reswords' && ret=0 + +fi + +return ret |