mirror of
https://git.code.sf.net/p/zsh/code
synced 2026-01-27 11:34:07 +00:00
33 lines
785 B
Plaintext
33 lines
785 B
Plaintext
#compdef chflags
|
|
|
|
local own='-g *(-u$EUID)'
|
|
local -a args recurse
|
|
|
|
(( ! EUID || $+_comp_priv_prefix )) && own=
|
|
|
|
case $OSTYPE in
|
|
(darwin|dragonfly|freebsd)*)
|
|
args=(
|
|
"-f[don't display diagnostic messages]"
|
|
'-v[verbose output]'
|
|
)
|
|
;|
|
|
darwin*|freebsd*)
|
|
recurse=( "-x[don't cross mount points]" )
|
|
;|
|
|
netbsd*)
|
|
args=( '-d[if the change requested would not alter the flags, attempt no change]' )
|
|
;|
|
|
esac
|
|
|
|
_arguments -s -A "-*" : $args \
|
|
': :_file_flags' \
|
|
'*:file:_files "$own"' \
|
|
- opth \
|
|
'-h[act on symlinks]' \
|
|
- optR $recurse \
|
|
'-R[recurse directories]' \
|
|
'(-L -P)-H[follow symlinks on the command line (specify with -R)]' \
|
|
'(-H -P)-L[follow all symlinks (specify with -R)]' \
|
|
'(-L -H)-P[do not follow symlinks (specify with -R)]'
|