summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_chmod
diff options
context:
space:
mode:
authorJoe Rayhawk <jrayhawk@fairlystable.org>2025-04-30 02:07:56 -0700
committerJoe Rayhawk <jrayhawk@fairlystable.org>2025-04-30 02:07:56 -0700
commit26e09889646be3ea65b4a3dfeda26213e4bb6a27 (patch)
tree4f3c73a9416bf47ad7e125383d23cf42879e38d7 /Completion/Unix/Command/_chmod
parent841bce705a58b04220b1f257abcc00ae71cbdbdc (diff)
parent001cba48ce3b964cf01fb3e2af54b20eacbc9bf5 (diff)
downloadzsh-26e09889646be3ea65b4a3dfeda26213e4bb6a27.tar.gz
zsh-26e09889646be3ea65b4a3dfeda26213e4bb6a27.zip
Merge branch 'upstream' into debian
Diffstat (limited to 'Completion/Unix/Command/_chmod')
-rw-r--r--Completion/Unix/Command/_chmod18
1 files changed, 9 insertions, 9 deletions
diff --git a/Completion/Unix/Command/_chmod b/Completion/Unix/Command/_chmod
index 42e3fa63b..5ec60d707 100644
--- a/Completion/Unix/Command/_chmod
+++ b/Completion/Unix/Command/_chmod
@@ -19,6 +19,13 @@ case "$variant" in
'*: :->files'
)
;;
+ gnu|freebsd*|openbsd*|netbsd*|darwin*|dragonfly*)
+ args+=(
+ '(-H -L -P)-L[follow all symlinks]'
+ '(-H -L -P)-H[follow symlinks on the command line]'
+ '(-H -L -P)-P[do not follow symlinks (default)]'
+ )
+ ;|
gnu)
aopts=()
args+=(
@@ -49,13 +56,6 @@ case "$variant" in
'-h[operate on symlinks themselves]'
)
;|
- freebsd*|openbsd*|netbsd*|darwin*|dragonfly*)
- args+=(
- '(-H -L -P)-L[follow all symlinks]'
- '(-H -L -P)-H[follow symlinks on the command line]'
- '(-H -L -P)-P[do not follow symlinks (default)]'
- )
- ;|
darwin*)
args+=(
'(1)-C[return false if any specified files have ACLs]'
@@ -67,13 +67,13 @@ case "$variant" in
;;
esac
-_arguments -C -s -S $aopts "$args[@]" && ret=0
+_arguments -C -s -S -0 $aopts "$args[@]" && ret=0
case "$state" in
files)
if [[ -n $opt_args[--reference] ]]; then
zmodload -F zsh/stat b:zstat 2>/dev/null
- typeset -i8 ref=$(zstat +mode $opt_args[--reference])
+ typeset -i8 ref=$(zstat +mode $opt_args[--reference]:Q)
_wanted files expl file _files -g "*(-.^f${ref#??})" && ret=0
elif [[ $line[1] = [0-7]## ]]; then
_wanted files expl file _files -g "*(-.^f$line[1])" && ret=0