diff options
author | Oliver Kiddle <opk@users.sourceforge.net> | 2001-04-01 16:19:15 +0000 |
---|---|---|
committer | Oliver Kiddle <opk@users.sourceforge.net> | 2001-04-01 16:19:15 +0000 |
commit | b9c58a73ac2eace89340b268db852c8a158bd707 (patch) | |
tree | ca4e713df765174bc90fcc2e8c2a3be9288905de | |
parent | e6be1f76cf77a63dd79dbe3d6eea62815caa87ab (diff) | |
download | zsh-b9c58a73ac2eace89340b268db852c8a158bd707.tar.gz zsh-b9c58a73ac2eace89340b268db852c8a158bd707.tar.xz zsh-b9c58a73ac2eace89340b268db852c8a158bd707.zip |
various doc fixes and minor completion function changes, most of which
are to use the -A "-*" and -S options to _arguments (13863)
-rw-r--r-- | ChangeLog | 18 | ||||
-rw-r--r-- | Completion/Builtins/_bindkey | 39 | ||||
-rw-r--r-- | Completion/Builtins/_compdef | 2 | ||||
-rw-r--r-- | Completion/Builtins/_disable | 2 | ||||
-rw-r--r-- | Completion/Builtins/_emulate | 2 | ||||
-rw-r--r-- | Completion/Builtins/_enable | 2 | ||||
-rw-r--r-- | Completion/Builtins/_fc | 45 | ||||
-rw-r--r-- | Completion/Builtins/_hash | 4 | ||||
-rw-r--r-- | Completion/Builtins/_print | 2 | ||||
-rw-r--r-- | Completion/Builtins/_read | 2 | ||||
-rw-r--r-- | Completion/Builtins/_unhash | 4 | ||||
-rw-r--r-- | Completion/Builtins/_vars_eq | 2 | ||||
-rw-r--r-- | Completion/Builtins/_which | 8 | ||||
-rw-r--r-- | Completion/Builtins/_zcompile | 12 | ||||
-rw-r--r-- | Completion/Builtins/_zle | 4 | ||||
-rw-r--r-- | Completion/Builtins/_zpty | 4 | ||||
-rw-r--r-- | Completion/Builtins/_zstyle | 9 | ||||
-rw-r--r-- | Completion/User/_bison | 10 | ||||
-rw-r--r-- | Completion/User/_bzip2 | 4 | ||||
-rw-r--r-- | Completion/User/_dirs | 2 | ||||
-rw-r--r-- | Completion/User/_fetchmail | 2 | ||||
-rw-r--r-- | Completion/User/_gzip | 2 | ||||
-rw-r--r-- | Doc/Zsh/builtins.yo | 4 | ||||
-rw-r--r-- | Doc/Zsh/compsys.yo | 45 | ||||
-rw-r--r-- | Doc/Zsh/compwid.yo | 6 | ||||
-rw-r--r-- | Doc/Zsh/expn.yo | 1 |
26 files changed, 139 insertions, 98 deletions
diff --git a/ChangeLog b/ChangeLog index e97da8e84..07c679dd7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,20 @@ -2001-04-01 Chmouel Boudjnah <chmouel@mandrakesoft.com> +2001-04-01 Oliver Kiddle <opk@zsh.org> + + * Completion/Builtins/_bindkey, Completion/Builtins/_compdef, + Completion/Builtins/_disable, Completion/Builtins/_emulate, + Completion/Builtins/_enable, Completion/Builtins/_fc, + Completion/Builtins/_hash, Completion/Builtins/_print, + Completion/Builtins/_read, Completion/Builtins/_unhash, + Completion/Builtins/_vars_eq, Completion/Builtins/_which, + Completion/Builtins/_zcompile, Completion/Builtins/_zle, + Completion/Builtins/_zpty, Completion/Builtins/_zstyle, + Completion/User/_bison, Completion/User/_bzip2, Completion/User/_dirs, + Completion/User/_fetchmail, Completion/User/_gzip, + Doc/Zsh/builtins.yo, Doc/Zsh/compsys.yo, Doc/Zsh/compwid.yo, + Doc/Zsh/expn.yo: various doc fixes and minor changes to completion + functions, including use of -A "-*" and -S options to _arguments. + +2001-04-01 Chmouel Boudjnah <chmouel@mandrakesoft.com> * 13861: Completion/Linux/_apm: Completion for apm command (linux only). diff --git a/Completion/Builtins/_bindkey b/Completion/Builtins/_bindkey index 048d517f2..45471feb5 100644 --- a/Completion/Builtins/_bindkey +++ b/Completion/Builtins/_bindkey @@ -7,31 +7,34 @@ # # Where appropriate, will complete keymaps instead of widgets. -local state expl line curcontext="$curcontext" +local state expl line curcontext="$curcontext" ret=1 typeset -A opt_args -_arguments -C -s \ - '(-v -a -M -l -D -A -N)-e[select emacs keymap and bind it to main]' \ - '(-e -a -M -l -D -A -N)-v[select viins keymap and bind it to main]' \ - '(-e -v -M -l -D -A -N)-a[select vicmd keymap]' \ - '(-e -v -a -l -D -A -N)-M[specify keymap to select]:keymap:->keymap' \ - '(-e -v -a -M -D -A -N -m -r -s -R *)-l[list existing keymap names]' \ +_arguments -C -s -S \ + '(-v -a -M -l -D -A -N -p)-e[select emacs keymap and bind it to main]' \ + '(-e -a -M -l -D -A -N -p)-v[select viins keymap and bind it to main]' \ + '(-e -v -M -l -D -A -N -p)-a[select vicmd keymap]' \ + '(-e -v -a -l -D -A -N -p)-M[specify keymap to select]:keymap:->keymap' \ + '(-e -v -a -M -D -A -N -m -p -r -s -R *)-l[list existing keymap names]' \ '(-e -v -a -d -A -N -m -r -s -R *)-L[output in form of bindkey commands]' \ - '(-e -v -a -l -D -A -N -m -r -s -R *)-d[delete existing keymaps and reset to default state]' \ - '(-e -v -a -M -l -d -A -N -m -r -s -R *)-D[delete named keymaps]:*:keymap:->keymap' \ - '(-e -v -a -M -l -L -d -D -N -m -r -s -R *)-A[create alias to keymap]:old-keymap:->keymap:new-keymap:->keymap' \ - '(-e -v -a -M -l -L -d -D -A -m -r -s -R *)-N[create new keymap]:new-keymap:->keymap:old-keymap to copy:->keymap' \ - '(-l -L -d -D -A -N -r -s -r -R *)-m[add builtin meta-key bindings to selected keymape]' \ - '(-l -L -d -D -A -N -m -s *)-r[unbind specified in-strings]:*:in-string' \ - '(-l -L -d -D -A -N -m -r *)-s[bind each in-string to each out-string]:*:key string' \ - '(-e -v -a -M -l -L -d -D -A -N -m)-R[interpret in-strings as ranges]' \ - '(-l -L -d -A -N -m -r -s)*::widgets:->widget' && return 0 + '(-e -v -a -l -D -A -N -m -p -r -s -R *)-d[delete existing keymaps and reset to default state]' \ + '(-e -v -a -M -l -d -A -N -m -p -r -s -R *)-D[delete named keymaps]:*:keymap:->keymap' \ + '(-e -v -a -M -l -L -d -D -N -m -p -r -s -R *)-A[create alias to keymap]:old-keymap:->keymap:new-keymap:->keymap' \ + '(-e -v -a -M -l -L -d -D -A -m -p -r -s -R *)-N[create new keymap]:new-keymap:->keymap:old-keymap to copy:->keymap' \ + '(-l -L -d -D -A -N -p -r -s -r -R *)-m[add builtin meta-key bindings to selected keymape]' \ + '(-e -v -a -M -d -D -A -N -m -r -s -R *)-p[list bindings which have given key sequence as a prefix]:key sequence' \ + '(-l -L -d -D -A -N -m -p -s *)-r[unbind specified in-strings]:*:in-string' \ + '(-l -L -d -D -A -N -m -p -r *)-s[bind each in-string to each out-string]:*:key string' \ + '(-e -v -a -M -l -L -d -D -A -N -m -p)-R[interpret in-strings as ranges]' \ + '(-l -L -d -A -N -m -p -r -s)*::widgets:->widget' && ret=0 case $state in keymap) - _wanted -C -M keymaps expl keymap compadd -a keymaps + _wanted -C -M keymaps expl keymap compadd -a keymaps && ret=0 ;; widget) - _wanted widgets expl widget compadd -M 'r:|-=* r:|=*' -k widgets + _wanted widgets expl widget compadd -M 'r:|-=* r:|=*' -k widgets && ret=0 ;; esac + +return ret diff --git a/Completion/Builtins/_compdef b/Completion/Builtins/_compdef index ab7c30e92..eb1a2ebb6 100644 --- a/Completion/Builtins/_compdef +++ b/Completion/Builtins/_compdef @@ -3,7 +3,7 @@ local state line expl list disp curcontext="$curcontext" typeset -A opt_args -_arguments -C -s \ +_arguments -C -s -A "-*" -S \ '(-d)-a[make function autoloadable]' \ '(-d -p -P)-n[leave existing definitions intact]' \ ':completion function:->cfun' \ diff --git a/Completion/Builtins/_disable b/Completion/Builtins/_disable index b3c2632ed..0e27944c9 100644 --- a/Completion/Builtins/_disable +++ b/Completion/Builtins/_disable @@ -1,6 +1,6 @@ #compdef disable -_arguments -C -s \ +_arguments -C -s -A "-*" -S \ "(-f -r)-a[act on aliases]:*:aliases:(${(k)aliases} ${(k)galiases})" \ "(-a -r)-f[act on functions]:*:functions:(${(k)functions})" \ "(-a -f)-r[act on reserved words]:*:reserved-words:(${(k)reswords})" \ diff --git a/Completion/Builtins/_emulate b/Completion/Builtins/_emulate index 1c1f63cde..e562d6834 100644 --- a/Completion/Builtins/_emulate +++ b/Completion/Builtins/_emulate @@ -1,6 +1,6 @@ #compdef emulate -_arguments -C -s \ +_arguments -C -s -A "-*" \ '-L[set local_options and local_traps as well]' \ '-R[reset all options instead of only those needed for script portability]' \ '::shell to emulate:(zsh sh ksh csh)' diff --git a/Completion/Builtins/_enable b/Completion/Builtins/_enable index 991286276..527423b3c 100644 --- a/Completion/Builtins/_enable +++ b/Completion/Builtins/_enable @@ -1,6 +1,6 @@ #compdef enable -_arguments -C -s \ +_arguments -C -s -A "-*" -S \ "(-f -r)-a[act on aliases]:*:aliases:(${(k)dis_aliases})" \ "(-a -r)-f[act on functions]:*:functions:(${(k)dis_functions})" \ "(-a -f)-r[act on reserved words]:*:reserved-words:(${(k)dis_reswords})" \ diff --git a/Completion/Builtins/_fc b/Completion/Builtins/_fc index cb3efe48f..40d88db27 100644 --- a/Completion/Builtins/_fc +++ b/Completion/Builtins/_fc @@ -1,27 +1,36 @@ -#compdef fc history +#compdef fc history r -local fc_common +local expl fc_common fc_hist fc_r -fc_common=( \ - '(-A -R -W -I)-m[treat first argument as a pattern]' \ - '(-A -R -W -I)-r[reverse order of the commands]' \ - '(-A -R -W -I -e)-n[suppress line numbers]' \ - '(-A -R -W -I -e -f -E -i)-d[print time-stamps]' \ - '(-A -R -W -I -e -d -E -i)-f[mm/dd/yyyy format time-stamps]' \ - '(-A -R -W -I -e -d -f -i)-E[dd.mm.yyyy format time-stamps]' \ - '(-A -R -W -I -e -d -f -E)-i[yyyy-mm-dd format time-stamps]' \ - '(-A -R -W -I -e)-D[print elapsed times]' \ +fc_common=( + '(-A -R -W -I)-r[reverse order of the commands]' + '(-A -R -W -I -e)-n[suppress line numbers]' '(-A -R -W -I)*::commands:_command_names -e' ) -if [[ $service = *history ]]; then - _arguments -C -s "$fc_common[@]" -else - _arguments -C -s \ - '(-A -R -W -I -e)-l[list resulting commands on stdout]' \ +fc_hist=( \ + '(-A -R -W -I)-m[treat first argument as a pattern]' + '(-A -R -W -I -e -f -E -i)-d[print time-stamps]' + '(-A -R -W -I -e -d -E -i)-f[mm/dd/yyyy format time-stamps]' + '(-A -R -W -I -e -d -f -i)-E[dd.mm.yyyy format time-stamps]' + '(-A -R -W -I -e -d -f -E)-i[yyyy-mm-dd format time-stamps]' + '(-A -R -W -I -e)-D[print elapsed times]' ) + +fc_r='(-A -R -W -I -e)-l[list resulting commands on stdout]' + +case $service in + history) + _arguments -C -s -S "$fc_common[@]" "$fc_hist[@]" && return 0 + ;; + r) + _arguments -C -s -S "$fc_common[@]" "$fc_r" && return 0 + ;; + *) + _arguments -C -s -S \ '(-A -R -W -I -l -n -d -f -E -i -D)-e[specify editor to invoke]:editor to invoke:_command_names -e' \ '(-l -m -e -r -n -d -f -E -i -D -A -W *)-R[read history from file]:history file:_files' \ '(-l -m -e -r -n -d -f -E -i -D -R -W *)-A[append history to file]:history file:_files' \ '(-l -m -e -r -n -d -f -E -i -D -R -A *)-W[write history to file]:history file:_files' \ '(-l -m -e -r -n -d -f -E -i -D -A -W *)-I[read/write new events only]:history file:_files' \ - "$fc_common[@]" -fi + "$fc_common[@]" "$fc_hist[@]" "$fc_r" && return 0 + ;; +esac diff --git a/Completion/Builtins/_hash b/Completion/Builtins/_hash index 8d7e51503..4b2a8a6ca 100644 --- a/Completion/Builtins/_hash +++ b/Completion/Builtins/_hash @@ -9,13 +9,13 @@ common_args=( \ case ${service} in hash) - _arguments -C -s \ + _arguments -C -s -S \ '(-f -m -v)-r[empty hash table]' \ '(-f -r)-m[treat arguments as patterns]' \ '(-f -r -m)-v[list entires as they are added]' \ '(-f -r -v)-L[list in the form of calls to hash]' \ "${common_args[@]}" \ - '(-d -f -r -m -v)*:hash:->hashval' && return 0 + '(-d -f -r -m -v -L)*:hash:->hashval' && return 0 ;; rehash) _arguments -C -s ${common_args[@]} && return 0 diff --git a/Completion/Builtins/_print b/Completion/Builtins/_print index 11b089a14..76b39f613 100644 --- a/Completion/Builtins/_print +++ b/Completion/Builtins/_print @@ -9,7 +9,7 @@ eflag="${words[1,CURRENT-1][(r)-*R*]:+-e[enable escapes]}" (:>&p) 2>/dev/null && pflag='(-s -u -z)-p[print arguments to input of coprocess]' -_arguments -C -s \ +_arguments -C -s -A "-*" -S \ '-r[ignore escape conventions of echo]' \ '(-r -b -m -s -l -N -o -O -i -c -u -p -z -D -P)-R[emulate BSD echo (no escapes, -n & -e flags only)]' \ '-b[recognise bindkey escape sequences]' \ diff --git a/Completion/Builtins/_read b/Completion/Builtins/_read index a648701d9..e49336475 100644 --- a/Completion/Builtins/_read +++ b/Completion/Builtins/_read @@ -6,7 +6,7 @@ local pflag expl line curcontext="$curcontext" (:>&p) 2>/dev/null && pflag='(-q -u -z)-p[input is read from the coprocess]' -_arguments -C -s \ +_arguments -C -s -A "-*" -S \ '-r[raw mode]' \ '(-p -k -u -z)-q[read y or n character from terminal]' \ '(-q)-k[specify number of characters to read]:number of characters' \ diff --git a/Completion/Builtins/_unhash b/Completion/Builtins/_unhash index 927511887..bf74f07c7 100644 --- a/Completion/Builtins/_unhash +++ b/Completion/Builtins/_unhash @@ -2,12 +2,12 @@ local expl state line curcontext="$curcontext" -_arguments -C -s \ +_arguments -C -s -S \ '(-a -f *)-d[remove named directories]:*:named directory:->nameddir' \ '(-d -f *)-a[remove aliases]:*:aliases:_aliases' \ '(-d -a *)-f[remove functions]:*:functions:_functions' \ '-m[treat arguments as patterns]' \ - '*:commands: _command_names -e' && return 0 + '(-a -d -f -m)*:commands: _command_names -e' && return 0 [[ "$state" = nameddir ]] && _wanted named-directories expl 'named directory' compadd -k nameddirs diff --git a/Completion/Builtins/_vars_eq b/Completion/Builtins/_vars_eq index 8bc8e6e63..c49066a2c 100644 --- a/Completion/Builtins/_vars_eq +++ b/Completion/Builtins/_vars_eq @@ -53,7 +53,7 @@ for ((i=1;i<=$#use;++i)); do ${allargs[${use[$i]}${${(s::)use[$i]}[(r)[Uut]]:+$func}]} ) done -_arguments -C -s "${args[@]}" '*:vars:->vars_eq' +_arguments -C -s -A "-*" -S "${args[@]}" '*:vars:->vars_eq' if [[ "$state" = vars_eq ]]; then if [[ $func = f ]]; then diff --git a/Completion/Builtins/_which b/Completion/Builtins/_which index da78b9358..ab6caeba7 100644 --- a/Completion/Builtins/_which +++ b/Completion/Builtins/_which @@ -13,14 +13,14 @@ aarg='-a[print all occurences in path]' case ${service} in whence) - _arguments -C -s \ + _arguments -C -s -A "-*" -S \ '(-c -w)-v[verbose output]' \ '(-v -w)-c[csh-like output]' \ "${cargs[@]}" "$farg" "$aarg" && return 0 ;; - where) _arguments -C -s "${cargs[@]}" && return 0;; - which) _arguments -C -s "${cargs[@]}" "$aarg" && return 0;; - type) _arguments -C -s "${cargs[@]}" "$aarg" "$farg" && return 0;; + where) _arguments -C -s -A "-*" -S "${cargs[@]}" && return 0;; + which) _arguments -C -s -A "-*" -S "${cargs[@]}" "$aarg" && return 0;; + type) _arguments -C -s -A "-*" -S "${cargs[@]}" "$aarg" "$farg" && return 0;; esac if [[ "$state" = command ]]; then diff --git a/Completion/Builtins/_zcompile b/Completion/Builtins/_zcompile index e9b9c60eb..2d8e6d033 100644 --- a/Completion/Builtins/_zcompile +++ b/Completion/Builtins/_zcompile @@ -1,9 +1,9 @@ #compdef zcompile -local state line expl curcontext="$curcontext" +local state line expl curcontext="$curcontext" ret=1 typeset -A opt_args -_arguments -C -s \ +_arguments -C -s -A "-*" -S \ '(-t -c -m -a)-U[don'\''t expand aliases]' \ '(-t -M)-R[mark as read]' \ '(-t -R)-M[mark as mapped]' \ @@ -14,11 +14,13 @@ _arguments -C -s \ '(-t -U -z -k)-a[write autoload functions]' \ '(-M -R -U -z -k -a -c -m)-t[show table of contents]' \ ':zwc file:_files' \ - '*:function:->function' && return 0 + '*:function:->function' && ret=0 if (( $+opt_args[-c] )); then - _wanted functions expl 'function to write' compadd -k functions + _wanted functions expl 'function to write' compadd -k functions && ret=0 else _description files expl 'zsh source file' - _files "$expl[@]" + _files "$expl[@]" && ret=0 fi + +return ret diff --git a/Completion/Builtins/_zle b/Completion/Builtins/_zle index 8a84b3697..2d707a22c 100644 --- a/Completion/Builtins/_zle +++ b/Completion/Builtins/_zle @@ -15,7 +15,7 @@ compwids=(accept-and-menu-complete opts=(-A -C -D -L -M -N -R -U -a -c -l \* :) -_arguments -s \ +_arguments -s -S \ "($opts)-A[define widget alias]:old widget:->widget :new widget:->widget" \ "($opts)-C[define completion widget]:new widget name:->comp-widget :completion widget:->builtin-comp-widget :widget shell function:->function" \ "($opts)-D[delete widget]:*:widget:->widget" \ @@ -30,7 +30,7 @@ _arguments -s \ '(-)::widget name:->call' [[ $state == listing ]] && - _arguments -s \ + _arguments -s -S \ "-l[list user-defined widgets]" \ "(-a)-L[list as commands]" \ "(-L)-a[list all widgets]" \ diff --git a/Completion/Builtins/_zpty b/Completion/Builtins/_zpty index b7e355149..4a02952f7 100644 --- a/Completion/Builtins/_zpty +++ b/Completion/Builtins/_zpty @@ -4,7 +4,7 @@ local state line list names expl curcontext="$curcontext" typeset -A opt_args -_arguments -C -s \ +_arguments -C -s -S \ '(-r -w -L -d)-e[echo input characters]' \ '(-r -w -L -d)-b[io to pseudo-terminal blocking]' \ '(-r -w -L -e -b)-d[delete command]:*:name:->name' \ @@ -17,7 +17,7 @@ _arguments -C -s \ # One could use sets, but that's more expensive and zpty is simple enough. # -# _arguments -C -s \ +# _arguments -C -s -S \ # - read \ # '-r[read string from command]' \ # ':name:->name' \ diff --git a/Completion/Builtins/_zstyle b/Completion/Builtins/_zstyle index 6a6d5787d..003ec4d9f 100644 --- a/Completion/Builtins/_zstyle +++ b/Completion/Builtins/_zstyle @@ -17,12 +17,17 @@ styles=( avoid-completer c: break-keys c: cache-path 'c:_wanted directories expl directory _path_files -/' + cache-policy c:_functions + call-command c:bool command c:command + commands c: + complete c:bool completer c:completer completions c:bool condition c:bool cursor c:cursor disable-stat c:bool + disabled c:bool domains c: expand c: fake-files c:fake-files @@ -32,6 +37,7 @@ styles=( force-list c: format c: glob c:bool + global c:bool group-name c: group-order c:tag groups c:_groups @@ -69,7 +75,8 @@ styles=( ports c:_ports prefix-hidden c:bool prefix-needed c:bool - prompt c: + range c: + regular c:bool remote-access c:bool remove-all-dups c:bool select-prompt c: diff --git a/Completion/User/_bison b/Completion/User/_bison index 000235f6f..350847cdd 100644 --- a/Completion/User/_bison +++ b/Completion/User/_bison @@ -1,20 +1,20 @@ #compdef bison -_arguments -s \ - '(--file-prefix)-b[specify output file prefix]:output file prefix:' \ +_arguments -s -S \ + '(--file-prefix)-b+[specify output file prefix]:output file prefix:' \ '(--defines)-d[write token definition file]' \ '(--raw)-r[output bison token numbers]' \ '(--token-table)-k[output token table]' \ '(--no-lines)-l[don'"'"'t generate #line directives]' \ '(--no-parser)-n[don'"'"'t generate parse (only declarations)]' \ - '(--output-file)-o[specify parser output file name]:parser file name:_files' \ - '(--name-prefix)-p[change yy prefix]:prefix string:' \ + '(--output-file)-o+[specify parser output file name]:parser file name:_files' \ + '(--name-prefix)-p+[change yy prefix]:prefix string:' \ '(--debug)-t[output YYDEBUG definition]' \ '(--verbose)-v[verbose mode]' \ '(--version)-V[show version]' \ '(--help)-h[show help]' \ '(--yacc --fixed-output-file)-y[imitate yacc'"'"'s output file convention]' \ - ':input file:_files -g \*.\(\#i\)\(bison\|yacc\)' \ + ':input file:_files -g \*.\(\#i\)\(bison\|yacc\|y\)' \ -- \ '*=outfile:parser file name:_files' \ '*file-prefix=prefix:output file prefix:' \ diff --git a/Completion/User/_bzip2 b/Completion/User/_bzip2 index cbb231c4d..951f85996 100644 --- a/Completion/User/_bzip2 +++ b/Completion/User/_bzip2 @@ -6,7 +6,7 @@ typeset -A opt_args case "$service" in bzip2recover) [[ $CURRENT = 2 ]] && state=files;; bzip2) decompress=no;& - bunzip2) _arguments -C -s \ + bunzip2) _arguments -C -s -S \ '(--help)-h[display help message]' \ '(-h)--help[display help message]' \ '(--decompress --compress -z --test -t)-d[decompress]' \ @@ -47,7 +47,7 @@ if [[ "$state" = files ]]; then (( $+opt_args[-z] || $+opt_args[--compress] )) && decompress=no (( $+opt_args[-d] || $+opt_args[--decompress] || $+opt_args[-t] || $+opt_args[--test] )) && unset decompress - if [[ -z "$decompress" ]] ; then + if [[ -z "$decompress" ]]; then _description files expl 'compressed file' _files "$expl[@]" -g '*.bz2' && return 0 else diff --git a/Completion/User/_dirs b/Completion/User/_dirs index 04c4b75d9..40d027188 100644 --- a/Completion/User/_dirs +++ b/Completion/User/_dirs @@ -1,3 +1,3 @@ -#compdef rmdir df du dircmp +#compdef rmdir df du dircmp dirs _files -/ diff --git a/Completion/User/_fetchmail b/Completion/User/_fetchmail index 0f9095107..31a92d984 100644 --- a/Completion/User/_fetchmail +++ b/Completion/User/_fetchmail @@ -1,6 +1,6 @@ #compdef fetchmail -_arguments \ +_arguments -S \ {--bsmtp,'(--logfile)-L','(-L)--logfile','(--fetchmailrc)-f','(-f)--fetchmailrc','(--idfile)-i','(-i)--idfile'}':file:_files' \ {--plugin,--plugout,'(--mda)-m','(-m)--mda'}':command:_command_names -e' \ {'(--username)-u','(-u)--username'}:user:_users \ diff --git a/Completion/User/_gzip b/Completion/User/_gzip index f5fad3c06..dc0399071 100644 --- a/Completion/User/_gzip +++ b/Completion/User/_gzip @@ -8,7 +8,7 @@ gunzip|zcat) decompress=yes ;& gzip) - _arguments -C -s \ + _arguments -C -s -S \ '(--to-stdout --stdout)-c[write on standard output]' \ '(-c --stdout)--to-stdout[write on standard output]' \ '(-c --to-stdout)--stdout[write on standard output]' \ diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo index 2093b7e74..6999bc256 100644 --- a/Doc/Zsh/builtins.yo +++ b/Doc/Zsh/builtins.yo @@ -258,6 +258,8 @@ The tt(-E) flag, or the tt(BSD_ECHO) option, can be used to disable these escape sequences. In the latter case, tt(-e) flag can be used to enable them. ) +module(echotc)(zsh/termcap) +module(echoti)(zsh/terminfo) findex(emulate) cindex(compatibility, sh) cindex(compatibility, ksh) @@ -938,8 +940,6 @@ Suspend the execution of the shell (send it a tt(SIGTSTP)) until it receives a tt(SIGCONT). Unless the tt(-f) option is given, this will refuse to suspend a login shell. ) -module(termcap)(zsh/termcap) -module(terminfo)(zsh/terminfo) findex(test) xitem(tt(test) [ var(arg) ... ]) item(tt([) [ var(arg) ... ] tt(]))( diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index f2e8f6bd3..85e1118f0 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -486,7 +486,7 @@ example(zstyle -e ':completion:*' completer ' One should be careful not to use too complicated code with this option, at least for the styles that are looked up quite often. These are basically those that define some global completion behaviour but -allow that to be different for all matches or groups as matches (such +allow that to be different for all matches or groups of matches (such as the tt(menu) and tt(list-rows-first) styles). Alternatively one can always use a less general pattern for the context than in the example above and use a second call to tt(zstyle) with a generic @@ -760,7 +760,7 @@ for communication ports ) kindex(prefixes, completion tag) item(tt(prefixes))( -for prefixes (like those of an URL) +for prefixes (like those of a URL) ) kindex(printers, completion tag) item(tt(printers))( @@ -942,8 +942,8 @@ with all matches will almost never be wanted. kindex(cache-path, completion style) item(tt(cache-path))( This style defines the path where any cache files containing dumped -completion data are stored. Defaults to `tt($DOTDIR/.zcompcache)', or -`tt($HOME/.zcompcache)' if tt($DOTDIR) is not defined. The completion +completion data are stored. Defaults to `tt($ZDOTDIR/.zcompcache)', or +`tt($HOME/.zcompcache)' if tt($ZDOTDIR) is not defined. The completion layer will not be used unless the tt(use-cache) style is set. ) kindex(call-command, completion style) @@ -980,8 +980,8 @@ process IDs to complete. Note that the completion function generally has to call the command everytime it is called. Because of that care should be taken to -specify only commands that take only a short time to run (and that -will eventually stop at all). +specify only commands that take a short time to run (and that will +eventually stop at all). ) kindex(commands, completion style) item(tt(commands))( @@ -1086,6 +1086,8 @@ such files really exist. This can be useful on systems that support special filesystems whose top-level pathnames can not be listed or generated with glob patterns. +It can also be used for directories for which one does not have read +permission. ) kindex(fake-parameters, completion style) item(tt(fake-parameters))( @@ -1197,24 +1199,24 @@ what these matches are. This string may also contain the sequences to specify output attributes, such as `tt(%B)', `tt(%S)' and `tt(%{)...tt(%})'. -For the same purpose, this style is also tested with the tags used -when matches are generated before it is tested for the -tt(descriptions) tag. This gives the possibility to define different -format strings for different types of matches. +For the same purpose, this style is also tested with the tags used when +matches are generated before it is tested for the tt(descriptions) +tag. This provides the possibility of defining different format +strings for different types of matches. Note also that some completer functions define additional `tt(%)'-sequences. These are described for the completer functions that make use of them. -For the tt(messages) tag, this defines a string used by some +For the tt(messages) tag, this style defines a string used by some completion functions to display messages. Here, the `tt(%d)' is -replaced with the message given by the completion function. +replaced with a message given by the completion function. -Finally, when set with the tt(warnings) tag, the format string is printed -when no matches could be generated at all. In this case the `tt(%d)' is -replaced with the descriptions for the matches that were expected -separated by spaces and the sequence `tt(%D)' is replaced with those -descriptions separated by newlines. +Finally, when set with the tt(warnings) tag, the format string is +printed when no matches could be generated at all. In this case the +`tt(%d)' is replaced with the descriptions for the matches that were +expected separated by spaces and the sequence `tt(%D)' is replaced with +those descriptions separated by newlines. The `tt(%)' for the sequences that are replaced by strings provided by the completion functions like the `tt(%d)' may be followed by field @@ -2308,13 +2310,14 @@ limit on the number of errors set by the tt(max-errors) style. Hence on the first try the completer field of the context contains `tt(approximate-1)', on the second try `tt(approximate-2)', and so on. -When tt(_approximate) is called from another function, the number of errors -to accept may be given with the tt(-a) option. Its argument should be -the same as the value of the tt(max-errors) style, all in one string. +When tt(_approximate) is called from another function, the number of +errors to accept may be given with the tt(-a) option. Its argument +should be the same as the value of the tt(max-errors) style, all in one +string. Note that this completer (and the tt(_correct) completer mentioned below) can be quite expensive to call, especially when a large number -of errors is allowed. One way to avoid this is to set up the +of errors are allowed. One way to avoid this is to set up the tt(completer) style using the tt(-e) option to zstyle so that some completers are only used when completion is attempted a second time on the same string, e.g.: diff --git a/Doc/Zsh/compwid.yo b/Doc/Zsh/compwid.yo index 065c2a096..8b3537100 100644 --- a/Doc/Zsh/compwid.yo +++ b/Doc/Zsh/compwid.yo @@ -250,7 +250,7 @@ positions, as indexes into the command line. ) vindex(last_prompt, compstate) item(tt(last_prompt))( -If this is set to an non-empty string for every match added, the +If this is set to a non-empty string for every match added, the completion code will move the cursor back to the previous prompt after the list of completions has been displayed. Initially this is set or unset according to the tt(ALWAYS_LAST_PROMPT) option. @@ -416,7 +416,7 @@ vindex(vared, compstate) item(tt(vared))( If completion is called while editing a line using the tt(vared) builtin, the value of this key is set to the name of the parameter -given as argument to tt(vared). This key is only set while a tt(vared) +given as an argument to tt(vared). This key is only set while a tt(vared) command is active. ) enditem() @@ -821,7 +821,7 @@ that this is not used if the command line contains a glob pattern and the tt(GLOB_COMPLETE) option is set or the tt(pattern_match) of the tt(compstate) special association is set to a non-empty string. -The var(match-spec) given as argument to the tt(-M) option (see +The var(match-spec) given as the argument to the tt(-M) option (see ifzman(`Builtin Commands' above)\ ifnzman(noderef(Builtin Commands))\ ) consists of one or more matching descriptions separated by diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo index d32ad5455..e49fa06cb 100644 --- a/Doc/Zsh/expn.yo +++ b/Doc/Zsh/expn.yo @@ -1122,6 +1122,7 @@ Matches any of the enclosed characters. Ranges of characters can be specified by separating two characters by a `tt(-)'. A `tt(-)' or `tt(])' may be matched by including it as the first character in the list. +cindex(character classes) There are also several named classes of characters, in the form `tt([:)var(name)tt(:])' with the following meanings: `tt([:alnum:])' alphanumeric, `tt([:alpha:])' alphabetic, |