diff options
Diffstat (limited to 'Completion/Zsh/Command')
-rw-r--r-- | Completion/Zsh/Command/_stat | 33 | ||||
-rw-r--r-- | Completion/Zsh/Command/_typeset | 14 | ||||
-rw-r--r-- | Completion/Zsh/Command/_which | 7 | ||||
-rw-r--r-- | Completion/Zsh/Command/_zed | 1 |
4 files changed, 15 insertions, 40 deletions
diff --git a/Completion/Zsh/Command/_stat b/Completion/Zsh/Command/_stat deleted file mode 100644 index 73bbef471..000000000 --- a/Completion/Zsh/Command/_stat +++ /dev/null @@ -1,33 +0,0 @@ -#compdef stat zstat - -local expl ret=1 - -if [[ $service == zstat ]] || - (( ${+builtins[stat]} )) || - { (( ! ${+builtins} )) && [[ $(type -w stat) == '*: builtin' ]] } -then - _arguments -s -S : \ - '(-H)-A[assign the results to array, don'\''t print]:array variable:_parameters -g "*array*"' \ - - set1 \ - +device +inode +mode +nlink +uid +gid +rdev \ - +size +atime +mtime +ctime +blksize +block +link \ - '(-A)-H[assign the results to associative array, don'\''t print]:associative array variable:_parameters -g "*association*"' \ - '(:)-f[stat a file descriptor]:file descriptor:_file_descriptors' \ - '(-s)-F:strftime(3) format string:_date_formats zsh' \ - '(-s)-g[show times in GMT/UTC]' \ - '-L[don'\''t dereference symbolic links; use lstat(2)]' \ - '(-N)-n[always show names of files]' \ - '(-n)-N[never show names of files]' \ - '-o[print file modes in octal rather than decimal]' \ - '-r[print raw data]' \ - '-s[print mode,uid,gid and times as strings]' \ - '(-T)-t[always show type names]' \ - '(-t)-T[never show type names]' \ - '*:files to stat:_files' \ - - set2 \ - '-l[list stat types]' -else - # TODO: system-specific completion - # TODO: choose this codepath if 'command stat ...' or '=stat ...' is used - _files -fi diff --git a/Completion/Zsh/Command/_typeset b/Completion/Zsh/Command/_typeset index 14d5d371b..fb7189c77 100644 --- a/Completion/Zsh/Command/_typeset +++ b/Completion/Zsh/Command/_typeset @@ -55,9 +55,13 @@ case ${service} in ;; float) use="EFHghlprtux";; functions) - use="UkmTtuzMW" + use="UkmTtuzW" func=f - allargs[M]='(-k -t -T -u -U -z -M +M +k +t +z)-+M[define mathematical function]' + 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]' + '(-M)-x+[specify spaces to use for indentation]:spaces' + ) ;; integer) use="Hghilprtux" @@ -89,8 +93,10 @@ if [[ "$state" = vars_eq ]]; then _wanted functions expl 'math function' compadd -F line - \ ${${${(f)"$(functions -M)"}##*-M }%% *} elif (( $+opt_args[-M] )); then - _arguments ':new math function:_functions' ':minimum arguments' \ - ':maximum arguments' ':shell function:_functions' + _arguments ':new math function:_functions' \ + ":minimum arguments${(k)opt_args[-s]:+:(1)}" \ + ":maximum arguments${(k)opt_args[-s]:+:(1)}" \ + ':shell function:_functions' elif (( $+opt_args[-w] )); then _wanted files expl 'zwc file' _files -g '*.zwc(-.)' elif [[ $service = autoload || -n $opt_args[(i)-[uU]] ]]; then diff --git a/Completion/Zsh/Command/_which b/Completion/Zsh/Command/_which index c43704ae8..9b789c86b 100644 --- a/Completion/Zsh/Command/_which +++ b/Completion/Zsh/Command/_which @@ -1,6 +1,6 @@ #compdef which whence where type -local farg aarg cargs args state line curcontext="$curcontext" ret=1 +local farg aarg xarg cargs args state line curcontext="$curcontext" ret=1 cargs=( \ '(-v -c)-w[print command type]' \ @@ -11,6 +11,7 @@ cargs=( \ '*:commands:->command' ) farg='-f[output contents of functions]' aarg='-a[print all occurrences in path]' +xarg='-x+[specify spaces to use for indentation in function expansion]:spaces' case ${service} in whence) @@ -19,8 +20,8 @@ case ${service} in '(-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;; + where) _arguments -C -s -A "-*" -S "${cargs[@]}" "$xarg" && ret=0;; + which) _arguments -C -s -A "-*" -S "${cargs[@]}" "$aarg" "$xarg" && ret=0;; type) _arguments -C -s -A "-*" -S "${cargs[@]}" "$aarg" "$farg" && ret=0;; esac diff --git a/Completion/Zsh/Command/_zed b/Completion/Zsh/Command/_zed index 211dae7df..6b68fadf0 100644 --- a/Completion/Zsh/Command/_zed +++ b/Completion/Zsh/Command/_zed @@ -5,5 +5,6 @@ case $service in (zed) _arguments -S : \ '(- 2):file:_files' \ '(1):shell function:_functions' \ + '(1)-x+[specify spaces to use for indentation in function expansion]:spaces' \ '(1)-f[edit function]';; esac |