From 0ba8ae87eac21281e0b17eb9cbb523d133067a4a Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Wed, 8 Jun 2005 12:45:24 +0000 Subject: 21315: make completion functions give precendence to descriptions passed as parameters and cleanup descriptons in calling functions --- Completion/Zsh/Command/_print | 2 +- Completion/Zsh/Command/_read | 2 +- Completion/Zsh/Command/_unhash | 2 +- Completion/Zsh/Type/_arrays | 2 +- Completion/Zsh/Type/_file_descriptors | 12 ++++++------ Completion/Zsh/Type/_functions | 2 +- Completion/Zsh/Type/_jobs_bg | 2 +- Completion/Zsh/Type/_jobs_fg | 2 +- Completion/Zsh/Type/_limits | 2 +- Completion/Zsh/Type/_options | 2 +- Completion/Zsh/Type/_options_set | 2 +- Completion/Zsh/Type/_options_unset | 6 +++--- 12 files changed, 19 insertions(+), 19 deletions(-) (limited to 'Completion/Zsh') diff --git a/Completion/Zsh/Command/_print b/Completion/Zsh/Command/_print index 07cb4de1d..af0501b7a 100644 --- a/Completion/Zsh/Command/_print +++ b/Completion/Zsh/Command/_print @@ -25,7 +25,7 @@ _arguments -C -s -A "-*" -S \ '(-n -l -N -f -s -z)-a[with -c/-C, print arguments across before down]' \ '(-n -l -N -f -C -s -z)-c[print arguments in columns]' \ '(-n -l -N -f -c -s -z)-C+[print arguments in specified number of columns]:columns' \ - '(-s -p -z)-u+[specify file-descriptor to print arguments to]:file-descriptor:_file_descriptors' \ + '(-s -p -z)-u+[specify file descriptor to print arguments to]:file descriptor:_file_descriptors' \ '(-s -p -u)-z[push arguments onto editing buffer stack]' \ '-D[substitute any arguments which are named directories using ~ notation]' \ '-P[perform prompt expansion]' \ diff --git a/Completion/Zsh/Command/_read b/Completion/Zsh/Command/_read index acf356a44..1f733b0e8 100644 --- a/Completion/Zsh/Command/_read +++ b/Completion/Zsh/Command/_read @@ -17,5 +17,5 @@ _arguments -s -A "-*" -S \ '(-e)-E[input read is echoed]' \ '(-q -z -p)-s[suppress terminal echoing]' \ '-A[first name is taken as an array]' \ - '(-q -z -p)-u+[specify file-descriptor to read from]:file-descriptor:_file_descriptors' \ + '(-q -z -p)-u+[specify file descriptor to read from]:file descriptor:_file_descriptors' \ $pflag '1:varprompt:_vars -qS\?' '*:vars:_vars' diff --git a/Completion/Zsh/Command/_unhash b/Completion/Zsh/Command/_unhash index 54c8d1669..c05c27ea3 100644 --- a/Completion/Zsh/Command/_unhash +++ b/Completion/Zsh/Command/_unhash @@ -6,7 +6,7 @@ _arguments -C -s -S \ '(-a -f -s *)-d[remove named directories]:*:named directory:->nameddir' \ '(-d -f -s *)-a[remove aliases]:*:alias:_aliases' \ '(-a -d -f *)-s[remove suffix aliases]:*:suffix alias:_aliases -s s' \ - '(-d -a -s *)-f[remove functions]:*:function:_functions' \ + '(-d -a -s *)-f[remove functions]:*:shell function:_functions' \ '-m[treat arguments as patterns]' \ '(-a -d -f -m)*:command: _command_names -e' && return 0 diff --git a/Completion/Zsh/Type/_arrays b/Completion/Zsh/Type/_arrays index c28fb179e..24c8957e8 100644 --- a/Completion/Zsh/Type/_arrays +++ b/Completion/Zsh/Type/_arrays @@ -2,4 +2,4 @@ local expl -_wanted arrays expl array _parameters "$@" -g '*array*' +_wanted arrays expl array _parameters "$@" - -g '*array*' diff --git a/Completion/Zsh/Type/_file_descriptors b/Completion/Zsh/Type/_file_descriptors index 3ea94a7b7..6d21ed2b6 100644 --- a/Completion/Zsh/Type/_file_descriptors +++ b/Completion/Zsh/Type/_file_descriptors @@ -2,7 +2,7 @@ local i fds expl list link sep -for i in {0..9}; [[ -e /dev/fd/$i ]] && fds=( ${fds[@]} $i ) +for i in {0..9}; [[ -e /dev/fd/$i ]] && fds+=( $i ) if zstyle -T ":completion:${curcontext}:" verbose && [[ -e /proc/$$/fd ]]; then zstyle -s ":completion:${curcontext}:" list-separator sep || sep=-- @@ -10,20 +10,20 @@ if zstyle -T ":completion:${curcontext}:" verbose && [[ -e /proc/$$/fd ]]; then if zmodload -e zsh/stat; then for i in "${fds[@]}"; do stat +link -A link /proc/$$/fd/$i - list=( ${list[@]} "$i $sep ${link[1]}" ) + list+=( "$i $sep ${link[1]}" ) done elif (( $+commands[readlink] )); then - for i in "${fds[@]}"; list=( ${list[@]} "$i $sep $(readlink /proc/$$/fd/$i)" ) + for i in "${fds[@]}"; list+=( "$i $sep $(readlink /proc/$$/fd/$i)" ) else for i in "${fds[@]}"; do - list=( ${list[@]} "$i $sep $(ls -l /proc/$$/fd/$i|sed 's/.*-> //' )" ) + list+=( "$i $sep $(ls -l /proc/$$/fd/$i|sed 's/.*-> //' )" ) done fi if (( $list[(I)* $sep ?*] )); then - _wanted file-descriptors expl 'file descriptors' compadd "$@" -d list -a fds + _wanted file-descriptors expl 'file descriptor' compadd "$@" -d list -a - fds return fi fi -_wanted file-descriptors expl 'file descriptors' compadd "$@" -a fds +_wanted file-descriptors expl 'file descriptor' compadd -a "$@" - fds diff --git a/Completion/Zsh/Type/_functions b/Completion/Zsh/Type/_functions index 7f818bd66..912a7f134 100644 --- a/Completion/Zsh/Type/_functions +++ b/Completion/Zsh/Type/_functions @@ -2,4 +2,4 @@ local expl -_wanted functions expl 'shell function' compadd "$@" -k functions +_wanted functions expl 'shell function' compadd -k "$@" - functions diff --git a/Completion/Zsh/Type/_jobs_bg b/Completion/Zsh/Type/_jobs_bg index 4362f8949..0c1842203 100644 --- a/Completion/Zsh/Type/_jobs_bg +++ b/Completion/Zsh/Type/_jobs_bg @@ -1,3 +1,3 @@ #compdef bg -_jobs -s +_jobs -s "$@" diff --git a/Completion/Zsh/Type/_jobs_fg b/Completion/Zsh/Type/_jobs_fg index e0f3012ef..57117f0d6 100644 --- a/Completion/Zsh/Type/_jobs_fg +++ b/Completion/Zsh/Type/_jobs_fg @@ -1,3 +1,3 @@ #compdef disown fg -_jobs +_jobs "$@" diff --git a/Completion/Zsh/Type/_limits b/Completion/Zsh/Type/_limits index 232ce7e94..11ee7efaa 100644 --- a/Completion/Zsh/Type/_limits +++ b/Completion/Zsh/Type/_limits @@ -2,4 +2,4 @@ local expl -_wanted limits expl 'process limits' compadd ${${(f)"$(limit)"}%% *} +_wanted limits expl 'process limit' compadd "$@" - ${${(f)"$(limit)"}%% *} diff --git a/Completion/Zsh/Type/_options b/Completion/Zsh/Type/_options index 351220bde..c6cf30d99 100644 --- a/Completion/Zsh/Type/_options +++ b/Completion/Zsh/Type/_options @@ -5,4 +5,4 @@ local expl _wanted zsh-options expl 'zsh option' \ - compadd "$@" -M 'B:[nN][oO]= M:_= M:{A-Z}={a-z}' -k options + compadd "$@" -M 'B:[nN][oO]= M:_= M:{A-Z}={a-z}' -k - options diff --git a/Completion/Zsh/Type/_options_set b/Completion/Zsh/Type/_options_set index 6082909fd..ddb57c3e2 100644 --- a/Completion/Zsh/Type/_options_set +++ b/Completion/Zsh/Type/_options_set @@ -7,4 +7,4 @@ local expl _wanted zsh-options expl 'set zsh option' \ - compadd "$@" -M 'B:[nN][oO]= M:_= M:{A-Z}={a-z}' -a _options_set + compadd "$@" -M 'B:[nN][oO]= M:_= M:{A-Z}={a-z}' -a - _options_set diff --git a/Completion/Zsh/Type/_options_unset b/Completion/Zsh/Type/_options_unset index 3af92f61c..32d58d427 100644 --- a/Completion/Zsh/Type/_options_unset +++ b/Completion/Zsh/Type/_options_unset @@ -1,10 +1,10 @@ #autoload # Complete all unset options. This relies on `_main_complete' to store the -# names of the options that were set when it was called in the array -# `_options_set'. +# names of the options that were unset when it was called in the array +# `_options_unset'. local expl _wanted zsh-options expl 'unset zsh option' \ - compadd "$@" -M 'B:[nN][oO]= M:_= M:{A-Z}={a-z}' -a _options_unset + compadd "$@" -M 'B:[nN][oO]= M:_= M:{A-Z}={a-z}' -a - _options_unset -- cgit 1.4.1