1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-14 01:51:22 +02:00

39208: Update flags

This commit is contained in:
Matthew Martin 2016-09-07 23:19:01 +02:00 committed by Oliver Kiddle
parent 1f429c0668
commit 48c31e21d3
2 changed files with 35 additions and 13 deletions

View file

@ -1,5 +1,11 @@
2016-09-07 Oliver Kiddle <opk@zsh.org>
39208: Matthew Martin: Completion/BSD/Command/_chflags:
Update flags
39223: Matthew Martin: Completion/BSD/Command/_chflags:
Introduce addflags function to reduce redundancy
39193: Completion/Unix/Type/_remote_files: don't pass options
from after -- on to compadd

View file

@ -15,32 +15,48 @@ addflags() {
}
addflags \
nodump nodump \
opaque opaque \
uappnd 'user append-only' \
uchg 'user immutable'
if (( ! EUID )); then
addflags \
arch archived \
nodump nodump \
sappnd 'system append-only' \
schg 'system immutable'
unset own
fi
if [[ $OSTYPE = (freebsd|dragonfly|darwin)* ]]; then
addflags \
hidden hidden \
uunlnk 'user undeletable'
if [[ $OSTYPE = (darwin|dragonfly|freebsd|netbsd)* ]]; then
addflags opaque opaque
if [[ $OSTYPE = darwin* ]]; then
addflags hidden hidden
fi
if [[ $OSTYPE = (dragonfly|freebsd)* ]]; then
addlfags uunlnk 'user undeletable'
(( EUID )) || addflags sunlnk 'system undeletable'
fi
[[ $OSTYPE = dragonflybsd* ]] && {
addflags \
cache XXX \
nouhistory 'user nohistory'
(( EUID )) || addflags \
noscache XXX \
noshistory 'system nohistory'
}
[[ $OSTYPE = freebsd* ]] && addflags \
offline offline \
rdonly readonly \
reparse 'Windows reparse point' \
sparse 'sparse file' \
system system
(( EUID )) || addflags sunlnk 'system undeletable'
uarch archive \
uhidden hidden \
uoffline offline \
urdonly 'DOS, Windows and CIFS readonly' \
ureparse 'Windows reparse point' \
usparse 'sparse file' \
usystem 'DOS, Windows and CIFS system'
args=(
"-f[don't display diagnostic messages]"