about summary refs log tree commit diff
path: root/Completion/BSD
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2005-05-30 09:46:57 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2005-05-30 09:46:57 +0000
commit887cbbdbed140808f0ec0faf5f7e7ecd4eccb7af (patch)
tree7c8a991a8958c532be90de0664cc9c4a0a746b49 /Completion/BSD
parente78a844b37920ac10bc5a5e558dbecea7e00518c (diff)
downloadzsh-887cbbdbed140808f0ec0faf5f7e7ecd4eccb7af.tar.gz
zsh-887cbbdbed140808f0ec0faf5f7e7ecd4eccb7af.tar.xz
zsh-887cbbdbed140808f0ec0faf5f7e7ecd4eccb7af.zip
Joerg Sonnenberger: 21252: Dragonfly BSD support
Diffstat (limited to 'Completion/BSD')
-rw-r--r--Completion/BSD/Command/_chflags45
1 files changed, 45 insertions, 0 deletions
diff --git a/Completion/BSD/Command/_chflags b/Completion/BSD/Command/_chflags
new file mode 100644
index 000000000..d6bcfe4b3
--- /dev/null
+++ b/Completion/BSD/Command/_chflags
@@ -0,0 +1,45 @@
+#compdef chflags
+
+local flags own='-g *(-u$EUID)'
+
+flags=(
+  '(noopaque)opaque[set the opaque flag]'
+  '(opaque)noopaque[unset the opaque flag]'
+  '(dump)nodump[set the nodump flag]'
+  '(nodump)dump[unset the nodump flag]'
+  '(nouappnd)uappnd[set the user append-only flag]'
+  '(uappnd)nouappnd[unset the user append-only flag]'
+  '(nouchg)uchg[set the user immutable flag]'
+  '(uchg)nouchg[unset the user immutable flag]'
+)
+
+if (( ! EUID )); then
+  flags=( $flags[@]
+    '(noarch)arch[set the archived flag]'
+    '(arch)noarch[unset the archived flag]'
+    '(nosappnd)sappnd[set the system append-only flag]'
+    '(sappnd)nosappnd[unset the system append-only flag]'
+    '(noschg)schg[set the system immutable flag]'
+    '(schg)noschg[unset the system immutable flag]'
+  )
+  unset own
+fi
+
+if [[ $OSTYPE = (freebsd|dragonfly)* ]]; then
+  flags=( $flags[@]
+    '(nouunlnk)uunlnk[set the user undeletable flag]'
+    '(uunlnk)nouunlnk[unset the user undeletable flag]'
+  )
+  (( EUID )) || flags=( $flags[@]
+    '(nosunlnk)sunlnk[set the system undeletable flag]'
+    '(sunlnk)nosunlnk[unset the system undeletable flag]'
+  )
+fi
+
+_arguments -s -A "-*" \
+  '(-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)]' \
+  '-R[recurse directories]' \
+  ':file flag:_values -s , "file flags" $flags[@]' \
+  '*:file:_files "$own"'