summaryrefslogtreecommitdiff
path: root/Completion/Zsh/Command
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Zsh/Command')
-rw-r--r--Completion/Zsh/Command/_cd2
-rw-r--r--Completion/Zsh/Command/_stat41
-rw-r--r--Completion/Zsh/Command/_typeset5
-rw-r--r--Completion/Zsh/Command/_zmodload2
-rw-r--r--Completion/Zsh/Command/_zstyle3
5 files changed, 35 insertions, 18 deletions
diff --git a/Completion/Zsh/Command/_cd b/Completion/Zsh/Command/_cd
index 6b8d7ebeb..46237e73d 100644
--- a/Completion/Zsh/Command/_cd
+++ b/Completion/Zsh/Command/_cd
@@ -22,7 +22,7 @@ _cd_options() {
setopt localoptions nonomatch
local expl ret=1 curarg
-integer argstart=2 noopts
+integer argstart=2 noopts match mbegin mend
if (( CURRENT > 1 )); then
# if not in command position, may have options.
diff --git a/Completion/Zsh/Command/_stat b/Completion/Zsh/Command/_stat
index 03e42e3af..73bbef471 100644
--- a/Completion/Zsh/Command/_stat
+++ b/Completion/Zsh/Command/_stat
@@ -2,19 +2,32 @@
local expl ret=1
-if [[ "$words[CURRENT-1]" = -[AH] ]]; then
- _arrays
+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
- _tags files options || return 1
-
- while _tags; do
- _requested files && _files && ret=0
- _requested options &&
- { ! zstyle -T ":completion:${curcontext}:options" prefix-needed ||
- [[ "$PREFIX[1]" = + || ret -eq 1 ]] } &&
- _all_labels options expl 'inode element' \
- compadd - +device +inode +mode +nlink +uid +gid +rdev \
- +size +atime +mtime +ctime +blksize +block +link
- (( ret )) || return 0
- done
+ # 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 160150234..14d5d371b 100644
--- a/Completion/Zsh/Command/_typeset
+++ b/Completion/Zsh/Command/_typeset
@@ -30,7 +30,7 @@ allargs=(
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]'
- p '-p[output parameters in form of calls to typeset]'
+ p '-p+[output parameters in form of calls to typeset]::option:((1\:multi-line\ output\ of\ arrays))'
r '(-f)-+r[mark parameters as readonly]'
rf '-r[remember autoload path]'
Rf '-R[remember autoload path, error if not found]'
@@ -41,6 +41,7 @@ allargs=(
uf '-u[mark function for autoloadling]'
up '-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]"
z "($popts -k -w)-+z[mark function for zsh-style autoloading]"
)
@@ -54,7 +55,7 @@ case ${service} in
;;
float) use="EFHghlprtux";;
functions)
- use="UkmTtuzM"
+ use="UkmTtuzMW"
func=f
allargs[M]='(-k -t -T -u -U -z -M +M +k +t +z)-+M[define mathematical function]'
;;
diff --git a/Completion/Zsh/Command/_zmodload b/Completion/Zsh/Command/_zmodload
index 57fb990e9..3416d50c6 100644
--- a/Completion/Zsh/Command/_zmodload
+++ b/Completion/Zsh/Command/_zmodload
@@ -17,6 +17,7 @@ _arguments -n -C -S -s \
'(-u -b -c -d -p -f -A -R -I)-F[handle features]' \
'(-u -b -c -d -p -f -A -R -I)-m[treat feature arguments as patterns]' \
'(-d -e)-i[suppress error if command would do nothing]' \
+ '(-d -e -L)-s[suppress error if module is not available]' \
'(-b -c -d -p -f -F -P -m)-I[define infix condition names]' \
'(-u -b -c -d -p -f -A -R)-l[list features]' \
'(-e -u)-L[output in the form of calls to zmodload]' \
@@ -71,6 +72,7 @@ else
_files -W module_path -g '*.(dll|s[ol]|bundle)(:r)' && ret=0
_requested aliases expl 'module alias' \
compadd "$suf[@]" -k 'modules[(R)alias*]' && ret=0
+ (( ret )) || return 0
done
return ret
fi
diff --git a/Completion/Zsh/Command/_zstyle b/Completion/Zsh/Command/_zstyle
index 0e828225e..7db73c0c0 100644
--- a/Completion/Zsh/Command/_zstyle
+++ b/Completion/Zsh/Command/_zstyle
@@ -1,7 +1,8 @@
#compdef zstyle
local state context ostate line expl ctop suf
-local nm=$compstate[nmatches] taglist patterns contexts
+local nm=$compstate[nmatches] taglist patterns contexts MATCH
+integer MBEGIN MEND
typeset -A opt_args styles
_vcs_info_hooks() {