summaryrefslogtreecommitdiff
path: root/Completion/Zsh/Command
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Zsh/Command')
-rw-r--r--Completion/Zsh/Command/_cd11
-rw-r--r--Completion/Zsh/Command/_fc2
-rw-r--r--Completion/Zsh/Command/_kill8
-rw-r--r--Completion/Zsh/Command/_typeset77
-rw-r--r--Completion/Zsh/Command/_vared2
-rw-r--r--Completion/Zsh/Command/_zle1
-rw-r--r--Completion/Zsh/Command/_zparseopts2
7 files changed, 62 insertions, 41 deletions
diff --git a/Completion/Zsh/Command/_cd b/Completion/Zsh/Command/_cd
index 46237e73d..9ca846c8f 100644
--- a/Completion/Zsh/Command/_cd
+++ b/Completion/Zsh/Command/_cd
@@ -70,8 +70,15 @@ else
tmpcdpath=(${${(@)cdpath:#.}:#$PWD})
- (( $#tmpcdpath )) &&
- alt=( 'path-directories:directory in cdpath:_path_files -W tmpcdpath -/' )
+ if zstyle -t ":completion:${curcontext}:path-directories" separate-sections; then
+ local elem
+ for ((elem=1; elem <= $#tmpcdpath; elem++)); do
+ alt+=( "path-directories-${elem}:directory in ${tmpcdpath[$elem]}:_path_files -W 'tmpcdpath[$elem]' -/" )
+ done
+ else
+ (( $#tmpcdpath )) &&
+ alt=( 'path-directories:directory in cdpath:_path_files -W tmpcdpath -/' )
+ fi
# With cdablevars, we can complete foo as if ~foo/
if [[ -o cdablevars && -n "$PREFIX" && "$PREFIX" != <-> ]]; then
diff --git a/Completion/Zsh/Command/_fc b/Completion/Zsh/Command/_fc
index 80e570c5d..626d35956 100644
--- a/Completion/Zsh/Command/_fc
+++ b/Completion/Zsh/Command/_fc
@@ -40,7 +40,7 @@ fc_hist=(
'(-A -R -W -e -d -E -i -t -a -p -P)-f[mm/dd/yyyy format time-stamps]'
'(-A -R -W -e -d -f -i -t -a -p -P)-E[dd.mm.yyyy format time-stamps]'
'(-A -R -W -e -d -f -E -t -a -p -P)-i[yyyy-mm-dd format time-stamps]'
- '(-A -R -W -e -d -f -E -i -a -p -P)-t[print time-stamps in specified format]:date format'
+ '(-A -R -W -e -d -f -E -i -a -p -P)-t[print time-stamps in specified format]: : _date_formats zsh'
'(-A -R -W -e -a -p -P)-D[print elapsed times]'
'(-A -R -W -I -e -d -f -i -l -m -n -r -D -E -t -P)-a[with -p, automatically pop history on function return]'
diff --git a/Completion/Zsh/Command/_kill b/Completion/Zsh/Command/_kill
index b9dfde3f0..3b5c02151 100644
--- a/Completion/Zsh/Command/_kill
+++ b/Completion/Zsh/Command/_kill
@@ -4,9 +4,11 @@ local curcontext="$curcontext" line state ret=1
typeset -A opt_args
_arguments -C \
- '(-s -l 1)-n[specify signal number]:signal number' \
- '(-n -l 1)-s[specify signal name]:signal:_signals -s' \
- '(-n -s)-l[list signal names or numbers of specified signals]:*:signal:_signals' \
+ '(-s -l -L 1)-n[specify signal number]:signal number' \
+ '(-l -L)-q[send the specified integer with the signal using sigqueue]:value' \
+ '(-n -l -L 1)-s[specify signal name]:signal:_signals -s' \
+ '-l[list signal names or numbers of specified signals]:*:signal:_signals' \
+ '(- *)-L[list each signal and corresponding number]' \
'(-n -s -l)1::signal:_signals -p -s' \
'*:processes:->processes' && ret=0
diff --git a/Completion/Zsh/Command/_typeset b/Completion/Zsh/Command/_typeset
index 058842378..99b9e7e0d 100644
--- a/Completion/Zsh/Command/_typeset
+++ b/Completion/Zsh/Command/_typeset
@@ -1,80 +1,87 @@
-#compdef autoload declare export functions integer float local readonly typeset
+#compdef autoload declare export functions integer float local nameref private readonly typeset
local expl state state_descr line func i use curcontext="$curcontext" ret=1
local fopts="-f -k -z +k +z"
-local popts="-A -E -F -L -R -T -Z -a -g -h -H -i -l -r -x"
+local popts="-A +A -E +E -F +F -L +L -R +R -T -Z +Z -a +a -g +g -h +h -H +H -i +i -l +l -n +n -r +r -x +x"
local -A allargs opt_args
local -a args
allargs=(
- A "($fopts -E -F -L -R -T -U -Z -a -i -m)-A[specify that arguments refer to associative arrays]"
- E "($fopts -A -F -L -R -T -U -Z -a -i -m)-E[floating point, use engineering notation on output]"
- F "($fopts -A -E -L -R -T -U -Z -a -i -m)-F[floating point, use fixed point decimal on output]"
- L "($fopts -A -E -F -i)-L+[left justify and remove leading blanks from value]:width"
- R "($fopts -A -E -F -i)-R+[right justify and fill with leading blanks]:width"
- T "($fopts -A -E -F -a -g -h -i -l -m -t)-T[tie scalar to array or trace function]"
- Tf "($popts -t)-T[trace execution of this function only]"
- Tp "($fopts -A -E -F -a -g -h -i -l -m -t)-T[tie scalar to array]"
- U '(-A -E -F -i)-U[keep array values unique and suppress alias expansion for functions]'
+ A "($fopts -A +A -E +E -F +F -L +L -R +R -T -U +U -Z +Z -a +a -i +i -m +m -n +n)-+A[specify that arguments refer to associative arrays]"
+ E "($fopts -A +A -E +E -F +F -L +L -R +R -T -U +U -Z +Z -a +a -i +i -m +m -n +n)-+E[floating point, use engineering notation on output]"
+ F "($fopts -A +A -E +E -F +F -L +L -R +R -T -U +U -Z +Z -a +a -i +i -m +m -n +n)-+F[floating point, use fixed point decimal on output]"
+ L "($fopts -A +A -E +E -F +F -L +L -R +R -i -n +n)-+L+[left justify and remove leading blanks from value]:width"
+ R "($fopts -A +A -E +E -F +F -L +L -R +R -i -n +n)-+R+[right justify and fill with leading blanks]:width"
+ T "($fopts -A +A -E -F -a +a -g -h -i -l +l -m +m -n +n -t)-T[tie scalar to array or trace function]"
+ Tf "($popts -t +t -T +T)-+T[trace execution of this function only]"
+ Tp "($fopts -A +A -E +E -F +F -a +a -g -h -i -l +l -m +m -n +n -t)-T[tie scalar to array]"
+ U '(-A +A -E +E -F +F -i)-U[keep array values unique and suppress alias expansion for functions]'
Uf '-U[suppress alias expansion for functions]'
- Up '(-E -F -i)-+U[keep array values unique]'
+ Up '(-E +E -F +F -i -n +n)-+U[keep array values unique]'
X '+X[immediately autoload function]'
- Z "($fopts -A -E -F -i)-Z+[right justify and fill with leading zeros]:width"
- a "($fopts -A -E -F -T -i)-a[specify that arguments refer to arrays]"
+ Z "($fopts -A +A -E +E -F +F -Z +Z -i -n +n)-+Z+[right justify and fill with leading zeros]:width"
+ a "($fopts -A +A -E +E -F +F -T -i +i)-+a[specify that arguments refer to arrays]"
df "-d[default absolute path autoload to fpath]"
- f "($popts)-f[specify that arguments refer to functions]"
- g "($fopts -T)-+g[do not restrict parameter to local scope]"
- h "($fopts -T)-+h[hide specialness of parameter]"
+ f "($popts -f +f)-+f[specify that arguments refer to functions]"
+ g "($fopts -T)-+g[don't restrict parameter to local scope]"
+ h "($fopts -T -n +n)-+h[hide specialness of parameter]"
H "($fopts -T)-+H[hide value of parameter in listings]"
- i "($fopts -A -E -F -T)-+i[represent internally as an integer]"
+ i "($fopts -A +A -E +E -F +F -T -n +n)-+i[represent internally as an integer]"
k "($popts -w -z)-+k[mark function for ksh-style autoloading]"
- l "($popts -T)-l[convert the value to lowercase]"
- m '(-A -E -F -T -i)-m[treat arguments as patterns]'
+ l "($popts -T -n +n)-+l[convert the value to lowercase]"
+ m '(-A +A -E +E -F +F -T -i -n)-+m[treat arguments as patterns]'
+ n "($fopts -A +A -E +E -F +F -L -R -T -U +U -Z +Z -a +a -i +i -h +h -l +l -m +m -t +t -x +x)-+n[make parameter a reference to another parameter]"
p '-p+[output parameters in form of calls to typeset]::option:((1\:multi-line\ output\ of\ arrays))'
- r '(-f)-+r[mark parameters as readonly]'
+ r '(-f -r +r)-+r[mark parameters as readonly]'
rf '-r[remember autoload path]'
Rf '-R[remember autoload path, error if not found]'
- t '(-T)-+t[tag parameters and turn on execution tracing for functions]'
- tf '(-T)-+t[turn on execution tracing for functions]'
- tp '(-T)-+t[tag parameters]'
+ t '(-T -n +n)-+t[tag parameters and turn on execution tracing for functions]'
+ tf '(-t +t -T +T)-+t[turn on execution tracing for functions]'
+ tp '(-T -n +n)-+t[tag parameters]'
u '-u[convert the value to uppercase or mark function for autoloading]'
- uf '-u[mark function for autoloadling]'
- up '-u[convert the value to uppercase]'
+ uf '-u[mark function for autoloading]'
+ up '(-u +u)-+u[convert the value to uppercase]'
w '(-k -z)-w[specify that arguments refer to files compiled with zcompile]'
W '-+W[turn on WARN_NESTED_VAR for function]'
- x "($fopts)-+x[export parameter]"
+ x "($fopts -n +n)-+x[export parameter]"
z "($popts -k -w)-+z[mark function for zsh-style autoloading]"
)
+allargs[rp]="$allargs[r]"
-use="AEFHLRTUZafghiklmprtuxz"
+use="AEFHLRTUZafghiklmnprtuxz"
case ${service} in
autoload)
use="URTXdkrtwz"
func=f
;;
- float) use="EFHghlprtux";;
+ float) use="EFHghlprtux" func=p ;;
functions)
use="UkmTtuzW"
func=f
args=(
- '(-k -t -T -u -U -W -x -z -M +M +k +t +W +z)-+M[define mathematical function]'
- '(-k -m -t -T -u -U -W -x -z +M +k +t +W +z)-s[define mathematical function that takes a string argument]'
+ '(-k -t -T +T -u -U -W -x -z -M +M +k +t +W +z)-+M[define mathematical function]'
+ '(-k -m +m -t -T +T -u -U -W -x -z +M +k +t +W +z)-s[define mathematical function that takes a string argument]'
'(-M)-x+[specify spaces to use for indentation]:spaces'
'(-* +*)-c[copy shell function to another name]:old name:_functions:new name:_functions'
)
;;
integer)
use="Hghilprtux"
+ func=p
allargs[i]='-i+[specify arithmetic base for output]:: :_guard "[0-9]#" base' \
;;
- readonly) use="${use/r/}" ;;
- local) use="${use//[fgkz]/}" ;;
- export) use="${use//[fgkxz]/}" ;;
+ readonly) use="${use//[nr]/}" func=p ;;
+ local) use="${use//[fgkpz]/}" func=p ;;
+ export) use="${use//[fgknxz]/}" func=p ;;
+ nameref) use="gpur" func=p ;;
+ private) use="${use//[fgkpzT]/}" func=p ;;
esac
-[[ -z "${words[(r)-*[aA]*]}" ]] || func=p
+[[ -z "${words[(r)-*[AEFHLRTZaghinrx]*]}" ]] || func=p
[[ -z "${words[(r)-*f*]}" ]] || func=f
+[[ $service = nameref || -n "${words[(r)-*n*]}" ]] &&
+ allargs[up]='-u[reference the upper (calling function) scope]'
# This function uses whacky features of _arguments which means we
# need to look for options to the command beforehand.
diff --git a/Completion/Zsh/Command/_vared b/Completion/Zsh/Command/_vared
index aba64880a..e7072ca6d 100644
--- a/Completion/Zsh/Command/_vared
+++ b/Completion/Zsh/Command/_vared
@@ -10,5 +10,7 @@ _arguments -s -A "-*" \
'-f+[specify finish widget]:widget:_widgets' \
'-h[allow access to history]' \
'-e[exit on EOF (^D)]' \
+ '-M+[specify keymap to link to main]:keymap:compadd -a keymaps' \
+ '-m+[specify keymap to link to vicmd]:keymap:compadd -a keymaps' \
'1:parameter spec:_vars'
diff --git a/Completion/Zsh/Command/_zle b/Completion/Zsh/Command/_zle
index 0b8ef7a15..97ec8c875 100644
--- a/Completion/Zsh/Command/_zle
+++ b/Completion/Zsh/Command/_zle
@@ -23,6 +23,7 @@ _arguments -s -S \
\(${(j. .)opts:#-[La]}')-l+[list user-defined widgets]:*:-:->listing' \
\(${(j. .)opts:#-l}')-a[with -l, list all widgets]' \
"(: * ${(j. .)opts:#-[Lw]})-F[install file descriptor handler]:file descriptor:_file_descriptors::handler:_functions" \
+ "($opts)-I[invalidate the current zle display]" \
"!($opts)-K:keymap:compadd -a keymaps" \
"($opts)-M[display message]:message: " \
"($opts)-N[define new widget]:widget name:->widget-or-function ::widget shell function:->function" \
diff --git a/Completion/Zsh/Command/_zparseopts b/Completion/Zsh/Command/_zparseopts
index e13a91081..ae81937c1 100644
--- a/Completion/Zsh/Command/_zparseopts
+++ b/Completion/Zsh/Command/_zparseopts
@@ -10,8 +10,10 @@ _arguments -A '-*' : \
'-D[remove parsed options from positional parameters]' \
"-E[don't stop parsing at first parameter not described by specs]" \
'-F[abort parsing and print error at first option-like parameter not described by specs]' \
+ '-G[enable GNU-style parsing]' \
'-K[preserve contents of arrays/associations when specs are not matched]' \
'-M[enable mapping among equivalent options with opt1=opt2 spec form]' \
+ '-v+[specify array from which to parse options]:array:_parameters -g "*array*"' \
'(-)-[end zparseopts options; specs follow]' \
'*: :->spec' \
&& ret=0