diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-12-01 15:29:41 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-12-01 15:29:41 +0000 |
commit | f844c87a4d676bcc8ad7ac24b5132d7aa5ccfeca (patch) | |
tree | c2a3b06a34243abe3826eead259bb08900f011f1 /Completion | |
parent | 26cf7b8d50f1b7d9d0b9115018ef4dc8624b5030 (diff) | |
download | zsh-f844c87a4d676bcc8ad7ac24b5132d7aa5ccfeca.tar.gz zsh-f844c87a4d676bcc8ad7ac24b5132d7aa5ccfeca.tar.xz zsh-f844c87a4d676bcc8ad7ac24b5132d7aa5ccfeca.zip |
zsh-workers/8840
Diffstat (limited to 'Completion')
50 files changed, 149 insertions, 207 deletions
diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments index 031ed90cf..0170ce307 100644 --- a/Completion/Base/_arguments +++ b/Completion/Base/_arguments @@ -194,7 +194,7 @@ if comparguments -i "$autod" "$@"; then while true; do while _tags; do if [[ -n "$matched" ]] || _requested arguments; then - _description expl "$descr" + _description arguments expl "$descr" if [[ "$action" = -\>* ]]; then comparguments -W line opt_args @@ -268,7 +268,7 @@ if comparguments -i "$autod" "$@"; then if comparguments -s single; then - _description expl option + _description options expl option if [[ "$single" = direct ]]; then compadd "$expl[@]" -QS '' - "${PREFIX}${SUFFIX}" diff --git a/Completion/Base/_brace_parameter b/Completion/Base/_brace_parameter index 2268b0068..a6892d944 100644 --- a/Completion/Base/_brace_parameter +++ b/Completion/Base/_brace_parameter @@ -1,29 +1,3 @@ #compdef -brace-parameter- _tags parameters && _parameters -e - - -# Without the `-e' option, we would use the following (see the file -# Core/_parameters for more enlightenment). - -# local lp ls n q - -# if [[ "$SUFFIX" = *\}* ]]; then -# ISUFFIX="${SUFFIX#*\}}$ISUFFIX" -# SUFFIX="${SUFFIX%%\}*}" -# suf=() -# elif [[ "$LBUFFER" = *\$\{[^}]#\$\{[^}]#$PREFIX || -# "$compstate[insert]" = *menu* ]]; then -# suf=(-b '') -# else -# suf=(-b ' ') -# fi - -# lp="$LBUFFER[1,-${#PREFIX}-1]" -# ls="$RBUFFER[${#SUFFIX}+1,-1]" -# n=${(M)#ls##\"#} -# q=${(M)lp%%\"#} - -# [[ n -gt 0 ]] && suf='' - -# _parameters "$suf[@]" -Qs "${q[1,-n-1]}" -r '-:?#%+=[/}' diff --git a/Completion/Base/_describe b/Completion/Base/_describe index 3d0d8507c..7be7ea29f 100644 --- a/Completion/Base/_describe +++ b/Completion/Base/_describe @@ -18,7 +18,7 @@ _tags "$_type" || return 1 _style "$_type" verbose && _showd=yes -_description _expl "$1" +_description "$_type" _expl "$1" shift if [[ -n "$_showd" ]]; then diff --git a/Completion/Base/_first b/Completion/Base/_first index 0e281d061..6740c00c5 100644 --- a/Completion/Base/_first +++ b/Completion/Base/_first @@ -34,7 +34,7 @@ # completion of words from the history by adding two commas at the end # and hitting TAB. # -# if [[ "$PREFIX" = *,, ]]; then +# if [[ "$PREFIX" = *,, ]] && _tags history-words; then # local max i=1 expl # # PREFIX="$PREFIX[1,-2]" @@ -51,9 +51,9 @@ # # twenty words, and so on... # while [[ i -le max ]]; do # if _style history-words sort; then -# _description expl "history ($n)" +# _description history-words expl "history ($n)" # else -# _description -V expl "history ($n)" +# _description -V history-words expl "history ($n)" # fi # if compadd "$expl[@]" -Q - \ # "${(@)${(@)historywords:#[\$'\"]*}[1,i*10]}"; then diff --git a/Completion/Base/_jobs b/Completion/Base/_jobs index 2a1b725b4..addc88607 100644 --- a/Completion/Base/_jobs +++ b/Completion/Base/_jobs @@ -11,15 +11,15 @@ _style jobs verbose && desc=yes if [[ "$1" = -r ]]; then jids=( "${(@k)jobstates[(R)running*]}" ) shift - _description expl 'running job' + _description jobs expl 'running job' elif [[ "$1" = -s ]]; then jids=( "${(@k)jobstates[(R)running*]}" ) shift - _description expl 'suspended job' + _description jobs expl 'suspended job' else [[ "$1" = - ]] && shift jids=( "${(@k)jobtexts}" ) - _description expl job + _description jobs expl job fi if [[ -n "$desc" ]]; then diff --git a/Completion/Base/_subscript b/Completion/Base/_subscript index cc3e9c435..21e62e8aa 100644 --- a/Completion/Base/_subscript +++ b/Completion/Base/_subscript @@ -19,7 +19,7 @@ elif [[ ${(Pt)${compstate[parameter]}} = array* ]]; then _tags indexes parameters while _tags; do - if _requested indexes -V expl 'array index'; then + if _requested -V indexes expl 'array index'; then ind=( {1..${#${(P)${compstate[parameter]}}}} ) if _style indexes verbose; then list=() diff --git a/Completion/Base/_tilde b/Completion/Base/_tilde index d9eb0a887..4aceca6ce 100644 --- a/Completion/Base/_tilde +++ b/Completion/Base/_tilde @@ -21,7 +21,7 @@ while _tags; do _requested named-directories expl 'named directory' && compadd "$suf[@]" "$expl[@]" "$@" - "${(@k)nameddirs}" - if _requested directory-stack -V expl 'directory stack' && + if _requested -V directory-stack expl 'directory stack' && { ! _style directory-stack prefix-needed || [[ "$PREFIX" = [-+]* ]] }; then if _style directory-stack verbose; then diff --git a/Completion/Base/_values b/Completion/Base/_values index eded48363..f35aa5a9a 100644 --- a/Completion/Base/_values +++ b/Completion/Base/_values @@ -76,7 +76,7 @@ if compvalues -i "$@"; then return 1 fi - _description expl "$descr" + _description arguments expl "$descr" # We add the separator character as a autoremovable suffix unless # we have only one possible value left. diff --git a/Completion/Builtins/_popd b/Completion/Builtins/_popd index e906571da..604bcecd5 100644 --- a/Completion/Builtins/_popd +++ b/Completion/Builtins/_popd @@ -9,7 +9,7 @@ setopt extendedglob nonomatch local expl list lines revlines disp -_wanted directory-stack -V expl 'directory stack' || return 1 +_wanted -V directory-stack expl 'directory stack' || return 1 ! _style directory-stack prefix-needed || [[ $PREFIX = [-+]* ]] || return 1 diff --git a/Completion/Commands/_history_complete_word b/Completion/Commands/_history_complete_word index 07db1eeb9..c5438148d 100644 --- a/Completion/Commands/_history_complete_word +++ b/Completion/Commands/_history_complete_word @@ -69,9 +69,9 @@ _history_complete_word () { _history_complete_word_gen_matches () { if _style history-words list; then if _style history-words sort; then - _description expl 'history word' + _description history-words expl 'history word' else - _description -V expl 'history word' + _description -V history-words expl 'history word' fi else if _style history-words sort; then diff --git a/Completion/Core/_alternative b/Completion/Core/_alternative index 76a8380bc..9d30884ae 100644 --- a/Completion/Core/_alternative +++ b/Completion/Core/_alternative @@ -25,7 +25,7 @@ while _tags; do descr="${${def#*:}%%:*}" action="${def#*:*:}" - _description expl "$descr" + _description "${def%%:*}" expl "$descr" if [[ "$action" = \ # ]]; then diff --git a/Completion/Core/_description b/Completion/Core/_description index 8cd9cc2fb..54518e49f 100644 --- a/Completion/Core/_description +++ b/Completion/Core/_description @@ -1,27 +1,33 @@ #autoload -local gropt=-J format +local gropt format gname -if [[ "$1" = -[VJ]* ]]; then - gropt="$1" +gropt=(-J) + +if [[ "$1" = -[VJ] ]]; then + gropt=("$1") + shift +elif [[ "$1" = -[VJ] ]]; then + gropt=("-${1[3,-1]}" "${1[1,2]}") shift fi -_lastdescr=( "$_lastdescr[@]" "$2" ) +_lastdescr=( "$_lastdescr[@]" "$3" ) _style -s descriptions format format +_style -s "$1" group-name gname && [[ -z "$gname" ]] && gname="$1" -if _style matches group; then +if [[ -n "$gname" ]]; then if [[ -n "$format" ]]; then - eval "$1=($gropt ${(q)2} -X ${(q)format//\\%d/$2})" + eval "$2=($gropt ${(q)gname} -X ${(q)format//\\%d/$3})" else - eval "$1=($gropt ${(q)2})" + eval "$2=($gropt ${(q)gname})" fi else if [[ -n "$format" ]]; then - eval "$1=(-X ${(q)format//\\%d/$2})" + eval "$2=(-J -default- -X ${(q)format//\\%d/$3})" else - eval "$1=()" + eval "$2=(-J -default-)" fi fi diff --git a/Completion/Core/_files b/Completion/Core/_files index ba5445797..9c5b45693 100644 --- a/Completion/Core/_files +++ b/Completion/Core/_files @@ -1,17 +1,24 @@ #autoload -local opts opt type=file +local opts opt type=file group opts=() +group=() while getopts "P:S:qr:R:W:F:J:V:X:f/g:M:" opt; do case "$opt" in /) [[ "$type" = file ]] && type=dir ;; g) [[ "$type" = (file|dir) ]] && type="$OPTARG" ;; q) opts=("$opts[@]" -q ) ;; + [JV]) group=( "-$opt" "$OPTARG") ;; [^f]) opts=("$opts[@]" "-$opt" "$OPTARG") ;; esac done +if [[ "$group[2]" = files ]]; then + opts=("$opts[@]" "$group[@]") + group=() +fi + case "$type" in file) _tags all-files ;; dir) _tags directories all-files ;; @@ -20,15 +27,19 @@ esac while _tags; do if _requested all-files; then + (( $#group )) && group[2]=all-files _path_files "$opts[@]" -f return elif _requested directories; then if _requested globbed-files; then + (( $#group )) && group[2]=globbed-files _path_files "$opts[@]" -/g "$type" && return 0 else + (( $#group )) && group[2]=directories _path_files "$opts[@]" -/ && return 0 fi elif _requested globbed-files; then + (( $#group )) && group[2]=globbed-files _path_files "$opts[@]" -g "$type" && return 0 fi done diff --git a/Completion/Core/_parameters b/Completion/Core/_parameters index 3735702df..c7875abcf 100644 --- a/Completion/Core/_parameters +++ b/Completion/Core/_parameters @@ -10,79 +10,3 @@ _wanted parameters expl parameter || return 1 pars=( ${(k)parameters[(R)^*local*]} ) compadd "$expl[@]" "$@" - $pars - - -# The `-e' option does everything for parameter expansions of us. If -# we wouldn't have it, we would use something like: - -# If the first argument is `-s' or `-b' auto_param_slash will be tested -# and slashes will be added to parameters containing a directory. `-s' is -# for parameter expansions without braces and `-b' is for expansions with -# braces. A `-' as the first argument is ignored and in all cases all -# other arguments will be given to `compadd'. - -# setopt localoptions extendedglob - -# local pars expl slash suf - -# if [[ "$1" = -s ]]; then -# slash=normal -# suf="$2" -# shift 2 -# elif [[ "$1" = -b ]]; then -# slash=brace -# suf="$2" -# shift 2 -# elif [[ "$1" = - ]]; then -# shift -# fi - -# _description expl parameter - -# if [[ -n "$slash" && -o autoparamslash ]]; then -# local i dirs nodirs ret=1 - -# dirs=() -# nodirs=() - -# if zmodload -e parameter; then -# setopt localoptions extendedglob -# nodirs=( ${(k)parameters[(R)undefined]} ) -# pars=( ${(k)parameters[(R)^*(local|undefined)*]} ) -# else -# nodirs=( ${${(M)${(f)"$(typeset +)"}:#undefined *}##* } ) -# pars=( ${${${(f)"$(typeset +)"}:#*(local|undefined) *}##* } ) -# fi - -# for i in $pars; do -# if [[ -d "${(P)i}" ]]; then -# dirs=( $dirs $i ) -# else -# nodirs=( $nodirs $i ) -# fi -# done - -# if [[ "$slash" = normal ]]; then -# compadd -S "/${suf%% #}" -r ' [/:' "$expl[@]" "$@" - $dirs && ret=0 -# compadd -S "$suf" -r ' [:' "$expl[@]" "$@" - $nodirs && ret=0 -# elif [[ "$slash" = brace ]]; then -# compadd -S "}/${suf%% #}" -r '-:?#%+=[/}' "$expl[@]" "$@" - $dirs && ret=0 -# compadd -S "}$suf" -r '-:?#%+=[/}' "$expl[@]" "$@" - $nodirs && ret=0 -# fi - -# return ret -# else -# if zmodload -e parameter; then -# pars=( ${(k)parameters[(R)^*local*]} ) -# else -# pars=( ${${${(f)"$(typeset +)"}:#*local *}##* } ) -# fi - -# if [[ "$slash" = normal ]]; then -# compadd -S "$suf" -r ' [:' "$expl[@]" "$@" - $pars -# elif [[ "$slash" = brace ]]; then -# compadd -S "}$suf" -r '-:?#%+=[/}' "$expl[@]" "$@" - $pars -# else -# compadd "$expl[@]" "$@" - $pars -# fi -# fi diff --git a/Completion/Core/_path_files b/Completion/Core/_path_files index 71ee3b218..2367def63 100644 --- a/Completion/Core/_path_files +++ b/Completion/Core/_path_files @@ -77,9 +77,9 @@ done if (( ! ( $#group + $#expl ) )); then if [[ "$sopt" = -/ ]]; then - _description expl directory + _description directories expl directory else - _description expl file + _description files expl file fi fi diff --git a/Completion/Core/_requested b/Completion/Core/_requested index 6641afdcf..3bc6f3b40 100644 --- a/Completion/Core/_requested +++ b/Completion/Core/_requested @@ -1,9 +1,17 @@ #autoload +local tag + +if [[ "$1" = -[VJ]* ]]; then + tag="$2" +else + tag="$1" +fi + comptags -C _cur_context -comptags -R "$1" && +comptags -R "$tag" && if [[ $# -gt 1 ]]; then - _description "${(@)argv[2,-1]}" + _description "$@" return 0 fi diff --git a/Completion/Core/_tags b/Completion/Core/_tags index 5294ab3c7..5519cc6cf 100644 --- a/Completion/Core/_tags +++ b/Completion/Core/_tags @@ -4,7 +4,7 @@ if (( $# )); then # We have arguments: the tags supported in this context. - local curcontext="$curcontext" + local curcontext="$curcontext" order if [[ "$1" = -C?* ]]; then curcontext="${curcontext}:${1[3,-1]}" @@ -18,6 +18,20 @@ if (( $# )); then [[ "$1" = -(|-) ]] && shift + + if _style -a '' group-order order; then + local name + + for name in "$order[@]"; do + compadd -J "$name" + compadd -V "$name" + compadd -J "$name" -1 + compadd -V "$name" -1 + compadd -J "$name" -2 + compadd -V "$name" -2 + done + fi + # Set and remember offered tags. comptags -i "$curcontext" "$@" diff --git a/Completion/Core/_wanted b/Completion/Core/_wanted index 7baa3e724..f95d74451 100644 --- a/Completion/Core/_wanted +++ b/Completion/Core/_wanted @@ -1,6 +1,6 @@ #autoload -local targs +local targs tag if [[ "$1" = -C?* ]]; then targs=( -C "${1[3,-1]}" ) @@ -12,10 +12,14 @@ else targs=() fi -[[ "$1" = -(|-) ]] && shift +if [[ "$1" = -[VJ]* ]]; then + tag="$2" +else + tag="$1" +fi if [[ $# -gt 1 ]]; then - _tags "$targs[@]" "$1" && _description "${(@)argv[2,-1]}" + _tags "$targs[@]" "$tag" && _description "$@" else - _tags "$targs[@]" "$1" + _tags "$targs[@]" "$tag" fi diff --git a/Completion/Core/compinit b/Completion/Core/compinit index 746b6c4d4..b313edede 100644 --- a/Completion/Core/compinit +++ b/Completion/Core/compinit @@ -326,6 +326,7 @@ your setup should be available in the file: \`${HOME}/.zsh-styles' +Note that the values for the style may not be fully correct. Have fun @@ -373,7 +374,7 @@ Have fun compstyle '*:options' prefix-hidden yes" ;; group_matches) - tmp="'*:matches' group 'yes'" + tmp="'*' group-name ''" ;; colors_path) tmp="'*:colors' path ${(qq)val}" diff --git a/Completion/Debian/_apt b/Completion/Debian/_apt index 72b28e907..80f9d8ab6 100644 --- a/Completion/Debian/_apt +++ b/Completion/Debian/_apt @@ -325,9 +325,9 @@ _describe -o option tmp2 -- tmp3 -S=' bool_prefix=($bool_prefix) local expl_opt expl_bool expl_configfile - _description expl_opt option - _description expl_bool 'bool value' - _description expl_configfile 'config file' + _description options expl_opt option + _description values expl_bool 'boolean value' + _description files expl_configfile 'config file' local current_option tmp1 tmp2 tmp3 @@ -388,8 +388,8 @@ _apt-get () { _apt-get () { local expl_action expl_packages - _description expl_action 'action' - _description expl_packages 'package' + _description actions expl_action 'action' + _description packages expl_packages 'package' _apt-get_sm } @@ -426,10 +426,10 @@ _apt-cache () { _apt-cache () { local expl_action expl_packages expl_pkg_cache expl_src_cache - _description expl_action 'action' - _description expl_packages 'package' - _description expl_pkg_cache 'package cache' - _description expl_src_cache 'source cache' + _description actions expl_action 'action' + _description packages expl_packages 'package' + _description files expl_pkg_cache 'package cache' + _description files expl_src_cache 'source cache' _apt-cache_sm } @@ -455,8 +455,8 @@ _apt-cdrom () { _apt-cdrom () { local expl_action expl_mount_point - _description expl_action 'action' - _description expl_mount_point 'mount point' + _description actions expl_action 'action' + _description files expl_mount_point 'mount point' _apt-cdrom_sm } @@ -481,9 +481,9 @@ _apt-config () { _apt-config () { local expl_action expl_shell_var expl_config_key - _description expl_action 'action' - _description expl_shell_var 'shell variable to assign' - _description expl_config_key 'configuration key' + _description actions expl_action 'action' + _description parameters expl_shell_var 'shell variable to assign' + _description configuration-keys expl_config_key 'configuration key' _apt-config_sm } diff --git a/Completion/Linux/_rpm b/Completion/Linux/_rpm index b31ea656f..fae8612a8 100644 --- a/Completion/Linux/_rpm +++ b/Completion/Linux/_rpm @@ -213,9 +213,9 @@ while [[ -n "$state" ]]; do ;; relocate) if compset -P '*\='; then - _description expl 'new path' + _description directories expl 'new path' else - _description expl 'old path' + _description directories expl 'old path' fi _tags directories || return 1 diff --git a/Completion/User/_bunzip2 b/Completion/User/_bunzip2 index 53f4388bc..48e56bf0f 100644 --- a/Completion/User/_bunzip2 +++ b/Completion/User/_bunzip2 @@ -2,5 +2,5 @@ local expl -_description expl 'compressed file' +_description files expl 'compressed file' _files "$expl[@]" -g '*.bz2' diff --git a/Completion/User/_bzip2 b/Completion/User/_bzip2 index 15dd6f090..0abdf4daa 100644 --- a/Completion/User/_bzip2 +++ b/Completion/User/_bzip2 @@ -2,5 +2,5 @@ local expl -_description expl 'file to compress' +_description files expl 'file to compress' _files "$expl[@]" -g '*~*.bz2' diff --git a/Completion/User/_compress b/Completion/User/_compress index 24363be07..ccffeaeef 100644 --- a/Completion/User/_compress +++ b/Completion/User/_compress @@ -2,5 +2,5 @@ local expl -_description expl 'file to compress' +_description files expl 'file to compress' _files "$expl[@]" -g '*~*.Z' diff --git a/Completion/User/_dd b/Completion/User/_dd index 3a980b48d..fb78f194a 100644 --- a/Completion/User/_dd +++ b/Completion/User/_dd @@ -10,10 +10,10 @@ if compset -P 1 'conv\='; then compadd "$expl[@]" -qS, -q \ ascii ebcdic ibm block unblock lcase ucase swab noerror sync elif compset -P 1 'if\='; then - _description expl 'input file' + _description files expl 'input file' _files "$expl[@]" elif compset -P 1 'of\='; then - _description expl 'output file' + _description files expl 'output file' _files "$expl[@]" else _wanted values expl option && diff --git a/Completion/User/_dvi b/Completion/User/_dvi index 4d36e237e..40794e246 100644 --- a/Completion/User/_dvi +++ b/Completion/User/_dvi @@ -89,7 +89,7 @@ dvitodvi) "$args[@]" ;; *) - _description expl 'DVI file' + _description files expl 'DVI file' _files "$expl[@]" -g '*.(dvi|DVI)' ;; esac diff --git a/Completion/User/_gdb b/Completion/User/_gdb index d037b83d9..a095370ab 100644 --- a/Completion/User/_gdb +++ b/Completion/User/_gdb @@ -12,7 +12,7 @@ if compset -P '-(cd|directory)='; then elif compset -P '-tty='; then _wanted devices expl 'terminal device' && compadd "$expl[@]" - /dev/tty* elif compset -P '-(exec|se)='; then - _description expl executable + _description files expl executable _files "$expl[@]" -g '*(*)' elif compset -P '-(symbols|core|command)='; then _files @@ -29,9 +29,9 @@ else case "$prev" in (-d) _files -/ && return 0 ;; (-[csx]) _files && return 0 ;; - (-e) _description expl executable + (-e) _description files expl executable _files "$expl[@]" -g '*(*)' && return 0 ;; - (-b) _wanted values expl -V expl 'baud rate' && + (-b) _wanted -V values expl 'baud rate' && compadd "$expl[@]" 0 50 75 110 134 150 200 300 600 1200 1800 \ 2400 4800 9600 19200 38400 57600 115200 \ 230400 && return 0 ;; @@ -46,7 +46,7 @@ else if [[ $#w -gt 1 ]]; then _alternative 'files:: _files' "processes:: _pids -m ${w[1]:t}" else - _description expl executable + _description files expl executable _files "$expl[@]" -g '*(*)' fi fi diff --git a/Completion/User/_gprof b/Completion/User/_gprof index a69a078ba..80de70bb4 100644 --- a/Completion/User/_gprof +++ b/Completion/User/_gprof @@ -41,12 +41,12 @@ if [[ -n "$state" ]]; then if [[ -n "$pair" ]]; then if compset -P '*/'; then - _description expl 'call arc to function' + _description functions expl 'call arc to function' else - _description expl 'call arc from function' + _description functions expl 'call arc from function' fi else - _description expl function + _description functions expl function fi compadd "$expl[@]" -M 'r:|_=* r:|=*' - "$_gprof_funcs[@]" && ret=0 else diff --git a/Completion/User/_gs b/Completion/User/_gs index 14f544425..35a1d5388 100644 --- a/Completion/User/_gs +++ b/Completion/User/_gs @@ -39,7 +39,7 @@ else compadd "$expl[@]" - "${(@)${=${$(gs -h)##* devices:}%%Search path:*}:#}" && ret=0 ;; *OutputFile\=) - _description expl 'output file' + _description files expl 'output file' _files "$expl[@]" && ret=0 ;; *) diff --git a/Completion/User/_gunzip b/Completion/User/_gunzip index 78e62c4cc..9c512bd30 100644 --- a/Completion/User/_gunzip +++ b/Completion/User/_gunzip @@ -2,5 +2,5 @@ local expl -_description expl 'compressed file' +_description files expl 'compressed file' _files "$expl[@]" -g '*.[gG][z]' diff --git a/Completion/User/_gzip b/Completion/User/_gzip index 07b51dead..e87682666 100644 --- a/Completion/User/_gzip +++ b/Completion/User/_gzip @@ -2,5 +2,5 @@ local expl -_description expl 'file to compress' +_description files expl 'file to compress' _files "$expl[@]" -g '*~*.[gG][zZ]' diff --git a/Completion/User/_mh b/Completion/User/_mh index e4d042dc2..bdd4c74b3 100644 --- a/Completion/User/_mh +++ b/Completion/User/_mh @@ -36,7 +36,7 @@ elif compset -P 1 '[+@]' || [[ "$prev" = -draftfolder ]]; then fi # painless, or what? - _description expl 'MH folder' + _description files expl 'MH folder' _path_files "$expl[@]" -W mhpath -/ elif [[ "$prev" = -(editor|(whatnow|rmm|show|more)proc) ]]; then _command_names -e @@ -50,7 +50,7 @@ elif [[ "$prev" = -(form|audit|filter) ]]; then [[ -d $mhlib ]] || { mhlib=$(mhparam mhlproc); mhlib=$mhlib:h; } mhfpath=($mymhdir $mhlib) - _description expl 'MH template file' + _description files expl 'MH template file' _files "$expl[@]" -W mhfpath -g '*(.)' elif [[ "$prev" = -(no|)cc ]]; then _wanted -C "$prev" values expl 'CC address' && diff --git a/Completion/User/_mutt b/Completion/User/_mutt index 98c59b2e0..c2af49107 100644 --- a/Completion/User/_mutt +++ b/Completion/User/_mutt @@ -28,10 +28,10 @@ if [[ "$state" = userhost ]]; then _tags hosts || return 1 if compset -P '*@'; then - _description expl 'remote host name' + _description hosts expl 'remote host name' _hosts "$expl[@]" -q -S, && return 0 else - _description expl 'login name' + _description users expl 'login name' _users "$expl[@]" -q -S@ && return 0 fi fi diff --git a/Completion/User/_netscape b/Completion/User/_netscape index 9dc3873a0..23601de12 100644 --- a/Completion/User/_netscape +++ b/Completion/User/_netscape @@ -78,7 +78,7 @@ if [[ "$state" = "urls" ]]; then license logo memory-cache mozilla plugins && ret=0 else if _tags prefixes; then - _description expl 'URL prefix' + _description prefixes expl 'URL prefix' compadd "$expl[@]" -S '' about: mocha: javascript: _urls "$@" && ret=0 fi diff --git a/Completion/User/_nslookup b/Completion/User/_nslookup index 13500ff2c..1aeae4306 100644 --- a/Completion/User/_nslookup +++ b/Completion/User/_nslookup @@ -66,9 +66,9 @@ if [[ -n "$compcontext" ]]; then _message "redirection not allowed for command \`$words[1]'" return 1 elif [[ "$compstate[redirect]" = '>' ]]; then - _description expl 'write to file' + _description files expl 'write to file' elif [[ "$compstate[redirect]" = '>>' ]]; then - _description expl 'append to file' + _description files expl 'append to file' else _message "unknown redirection operator \`$compstate[redirect]'" return 1 @@ -107,7 +107,7 @@ if [[ -n "$compcontext" ]]; then return ;; view) - _description expl 'view file' + _description files expl 'view file' _files "$expl[@]" return ;; @@ -144,9 +144,9 @@ if [[ -n "$state" ]]; then _tags hosts || return 1 if compset -P '*/'; then - _description expl 'search list entry' + _description hosts expl 'search list entry' else - _description expl 'default domain name and first search list entry' + _description hosts expl 'default domain name and first search list entry' fi if [[ -n "$_vals_cache_multi" ]]; then _hosts "$expl[@]" -qS/ -r "/\\- \\t\\n$_vals_cache_multi" diff --git a/Completion/User/_pack b/Completion/User/_pack index a15cfa709..39539ee61 100644 --- a/Completion/User/_pack +++ b/Completion/User/_pack @@ -2,5 +2,5 @@ local expl -_description expl 'file to compress' +_description files expl 'file to compress' _files "$expl[@]" -g '*~*.z' diff --git a/Completion/User/_pbm b/Completion/User/_pbm index 9eecd0390..7eff60c69 100644 --- a/Completion/User/_pbm +++ b/Completion/User/_pbm @@ -18,7 +18,7 @@ fi if [[ $# -ne 0 || $+_in_pbm -ne 0 ]]; then if (( ! $# )); then - _description expl 'picture file' + _description files expl 'picture file' set -- "$expl[@]" fi _files "$@" -g "$pat" || _files "$@" -g '*.(#i)p[bgp]m' @@ -258,7 +258,7 @@ pgmtoppm) return ret elif [[ CURRENT -eq 3 && "$words[2]" = -map ]]; then - _description expl 'map file' + _description files expl 'map file' _files "$expl[@]" -g '*.(#i)ppm' else _pbm @@ -516,9 +516,9 @@ ppmchange) _pbm && ret=0 if (( CURRENT & 1 )); then - _description expl 'new color' + _description colors expl 'new color' else - _description expl 'old color' + _description colors expl 'old color' fi _x_color "$expl[@]" && ret=0 @@ -600,7 +600,7 @@ ppmquant) return ret elif [[ CURRENT -eq 3 && "$words[2]" = -map ]]; then - _description expl 'map file' + _description files expl 'map file' _files "$expl[@]" -g '*.(#i)ppm' else _pbm @@ -742,7 +742,7 @@ rgb3toppm) fi if [[ -n "$expl" ]]; then - _description expl "$expl" + _description files expl "$expl" _files "$expl" -g '*.(#i)pgm' fi ;; @@ -772,7 +772,7 @@ zeisstopnm) _arguments '(-pgm -ppm)'-p{g,p}m ':file: _pbm' ;; -*) - _description expl 'picture file' +*) + _description files expl 'picture file' _files "$expl[@]" -g "$pat" || _files "$expl[@]" -g '*.(#i)p[bgp]m' esac diff --git a/Completion/User/_pdf b/Completion/User/_pdf index 795e8545b..efc511669 100644 --- a/Completion/User/_pdf +++ b/Completion/User/_pdf @@ -7,5 +7,5 @@ local expl # xpdf: # pdfimages pdfinfo pdftopbm pdftops pdftotext xpdf -_description expl 'PDF file' +_description files expl 'PDF file' _files "$expl[@]" -g '*.(#i)pdf' diff --git a/Completion/User/_ps b/Completion/User/_ps index 086443586..c8d1bd53a 100644 --- a/Completion/User/_ps +++ b/Completion/User/_ps @@ -9,5 +9,5 @@ local expl # fixscribeps fixtpps fixwfwps fixwpps fixwwps includeres psbook psmerge # psnup psresize psselect pstops -_description expl 'postscript file' +_description files expl 'postscript file' _files "$expl[@]" -g '*.(#i)(ps|eps)' diff --git a/Completion/User/_pspdf b/Completion/User/_pspdf index b4dadb3d0..7dbccbf48 100644 --- a/Completion/User/_pspdf +++ b/Completion/User/_pspdf @@ -6,7 +6,7 @@ local ret=1 expl # gs gsbj gsdj gsdj500 gslj gslp gsnd ps2ascii _ps && ret=0 -_description expl 'PDF file' +_description files expl 'PDF file' _path_files "$expl[@]" -g '*.(#i)pdf' return ret diff --git a/Completion/User/_ssh b/Completion/User/_ssh index 4318caf96..9b07a62cf 100644 --- a/Completion/User/_ssh +++ b/Completion/User/_ssh @@ -57,7 +57,7 @@ _ssh () { ret=0 ;; *(#i)globalknownhostsfile*) - _description expl 'global file with known hosts' + _description files expl 'global file with known hosts' _files "$expl[@]" && ret=0 ;; *(#i)hostname*) @@ -65,7 +65,7 @@ _ssh () { _ssh_hosts "$expl[@]" && ret=0 ;; *(#i)identityfile*) - _description expl 'SSH identity file' + _description files expl 'SSH identity file' _files "$expl[@]" && ret=0 ;; *(#i)(local|remote)forward*) @@ -82,7 +82,7 @@ _ssh () { compadd "$expl[@]" yes no ask ;; *(#i)userknownhostsfile*) - _description expl 'user file with known hosts' + _description files expl 'user file with known hosts' _files "$expl[@]" && ret=0 ;; *(#i)user*) @@ -90,7 +90,7 @@ _ssh () { _ssh_users "$expl[@]" && ret=0 ;; *(#i)xauthlocation*) - _description expl 'xauth program' + _description files expl 'xauth program' _files "$expl[@]" -g '*(*)' && ret=0 ;; esac diff --git a/Completion/User/_strip b/Completion/User/_strip index 529176fdd..378eafe99 100644 --- a/Completion/User/_strip +++ b/Completion/User/_strip @@ -2,5 +2,5 @@ local expl -_description expl executable +_description files expl executable _files "$expl[@]" -g '*(*)' diff --git a/Completion/User/_tar_archive b/Completion/User/_tar_archive index 9ddf434f5..2c2696481 100644 --- a/Completion/User/_tar_archive +++ b/Completion/User/_tar_archive @@ -11,7 +11,7 @@ local expl [[ $# -eq 0 && $+_tar_cmd -ne 0 ]] && set "$_tar_cmd" -_description expl 'archive file' +_description files expl 'archive file' if [[ "$1" = *[tx]* ]]; then if [[ "$1" = *[zZ]* ]]; then diff --git a/Completion/User/_tex b/Completion/User/_tex index d270c785a..4775d1bbc 100644 --- a/Completion/User/_tex +++ b/Completion/User/_tex @@ -2,5 +2,5 @@ local expl -_description expl 'TeX or LaTeX file' +_description files expl 'TeX or LaTeX file' _files "$expl[@]" -g '*.(tex|TEX|texinfo|texi)' diff --git a/Completion/User/_tiff b/Completion/User/_tiff index 27ab33227..a0fb0d4b4 100644 --- a/Completion/User/_tiff +++ b/Completion/User/_tiff @@ -10,7 +10,7 @@ fi if [[ $# -ne 0 || $+_in_tiff -ne 0 ]]; then if (( ! $# )); then - _description expl 'picture file' + _description files expl 'picture file' set -- "$expl[@]" fi _path_files "$@" -g "$pat" || _files "$@" -g '*.(#i)tiff' @@ -166,7 +166,7 @@ pal2rgb) ':output file:_files -g \*.\(\#i\)tiff' && ret=0 ;; *) - _description expl 'picture file' + _description files expl 'picture file' _files "$expl[@]" -g "$pat" && ret=0 esac diff --git a/Completion/User/_uncompress b/Completion/User/_uncompress index f352ca15a..a0ac14484 100644 --- a/Completion/User/_uncompress +++ b/Completion/User/_uncompress @@ -2,5 +2,5 @@ local expl -_description expl 'compressed file' +_description files expl 'compressed file' _files "$expl[@]" -g '*.Z' diff --git a/Completion/User/_unpack b/Completion/User/_unpack index fb8867560..7345c2e94 100644 --- a/Completion/User/_unpack +++ b/Completion/User/_unpack @@ -2,5 +2,5 @@ local expl -_description expl 'compressed file' +_description files expl 'compressed file' _files "$expl[@]" -g '*.z' diff --git a/Completion/User/_users_on b/Completion/User/_users_on index 3d35af02b..0589e7059 100644 --- a/Completion/User/_users_on +++ b/Completion/User/_users_on @@ -5,7 +5,7 @@ local expl _tags users || return 1 if which users >/dev/null; then - _description expl 'users logged on' + _description users expl 'users logged on' compadd "$@" "$expl[@]" - $(users) && return 0 else # Other methods of finding out users logged on should be added here diff --git a/Completion/X/_x_window b/Completion/X/_x_window index bf0ad4d33..139210f32 100644 --- a/Completion/X/_x_window +++ b/Completion/X/_x_window @@ -9,11 +9,11 @@ list=( "${(@)${(M@)${(@f)$(xwininfo -root -tree)}:#[ ]#0x[0-9a-f]# \"*}##[ ]#} if [[ "$1" = -n ]]; then shift - _description expl 'window name' + _description windows expl 'window name' compadd "$@" "$expl[@]" -d list - "${(@)${(@)list#*\"}%%\"*}" else [[ "$1" = - ]] && shift - _description expl 'window ID' + _description windows expl 'window ID' compadd "$@" "$expl[@]" -d list - "${(@)list%% *}" fi diff --git a/Completion/X/_xmodmap b/Completion/X/_xmodmap index e1594b949..da0029a16 100644 --- a/Completion/X/_xmodmap +++ b/Completion/X/_xmodmap @@ -55,7 +55,7 @@ if [[ -n "$state" ]]; then pointer*) if compset -P '*=[ ]#'; then compset -P '*[ ]' - _description expl 'button code' + _description values expl 'button code' compadd "$expl[@]" -qS ' ' 1 2 3 4 5 default return else |