summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_chmod
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2018-04-07 15:12:57 +0200
committerAxel Beckert <abe@deuxchevaux.org>2018-04-07 15:12:57 +0200
commit6e1ab9aa550695ee7e3d467b4173c0b83ba7f759 (patch)
tree8fb7faa4364a7cbf1cba48296a5f537e13f2a8d9 /Completion/Unix/Command/_chmod
parent5ad56a41f1ee2e61abca079f5ea8909f895ac2dd (diff)
parentf027f1d6e876708bc75d4217e1ca26898658d8d3 (diff)
downloadzsh-6e1ab9aa550695ee7e3d467b4173c0b83ba7f759.tar.gz
zsh-6e1ab9aa550695ee7e3d467b4173c0b83ba7f759.zip
Merge tag 'zsh-5.4.2-test-2' / 'upstream' branch into 'debian' branch
Test version 2 prior to zsh 5.5.
Diffstat (limited to 'Completion/Unix/Command/_chmod')
-rw-r--r--Completion/Unix/Command/_chmod25
1 files changed, 1 insertions, 24 deletions
diff --git a/Completion/Unix/Command/_chmod b/Completion/Unix/Command/_chmod
index 85e6df1ae..af64b9eb9 100644
--- a/Completion/Unix/Command/_chmod
+++ b/Completion/Unix/Command/_chmod
@@ -3,7 +3,7 @@
local curcontext="$curcontext" state line expl ret=1
local -a args privs
-args=( '*:file:->files' '1:mode:->mode' )
+args=( '*: :->files' '1: :_file_modes' )
if _pick_variant gnu=Free\ Soft unix --version; then
args+=(
@@ -45,35 +45,12 @@ else
'(1)-I[removes all inherited entries from named files ACLs]'
)
;;
- solaris*) privs=( 'l[mandatory locking]' ) ;;
esac
fi
_arguments -C -s "$args[@]" && ret=0
case "$state" in
- mode)
- compset -P \*,
- compset -S ,\*
- if [[ -prefix [0-7] ]]; then
- _message -e number 'numeric mode'
- elif compset -P '[a-z]#[+-=]'; then
- _values -S '' privilege \
- 'r[read]' 'w[write]' 'x[execute]' \
- 's[set uid/gid]' 't[sticky]' \
- 'X[execute only if directory or executable to another]' \
- "u[owner's current permissions]" \
- "g[group's current permissions]" \
- "o[other's current permissions]" \
- "$privs[@]" && ret=0
- else
- suf=( -S '' )
- compset -P '*'
- _alternative -O suf \
- 'who:who:((u\:user g\:group a\:all o\:others))' \
- 'operators:operator:(+ - =)' && ret=0
- fi
- ;;
files)
if [[ -n $opt_args[--reference] ]]; then
zmodload -F zsh/stat b:zstat 2>/dev/null