Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[patch 2/3] _chflags: Update flags
- X-seq: zsh-workers 39208
- From: Matthew Martin <phy1729@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [patch 2/3] _chflags: Update flags
- Date: Tue, 6 Sep 2016 23:00:45 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=gmail.com; s=20120113;        h=date:from:to:subject:message-id:mail-followup-to:mime-version         :content-disposition:user-agent;        bh=YIhpMO9CnaoqWI+EBOHlYeguonHLEU97Gw5iW1+AIXM=;        b=HX+Kj+CSske243g4zRmQ7TgALSDxmFwql6mVkIk+H7j5wKXwRcG47BUKTGwiQCOKIl         dHMcEtXmN30tXHn7an4l/ZuTJ0lzFSriovdrXpZ8rpJ+b9omcgKnFZ9EHM0MWKuICjaH         qoNH1Hkj/i+4ml+YkpALA62gl+LyJVso6NmfghaAkpVJmwboYoVZ9C5zRIJ/ftjkZya2         P8IVziC3xBxCMZrRWlFb34q0TSeVVjG1WgQHLRm7JdrLyrwiefCBydJehsRhQ055F1kw         g9RSE+9YvhxSN4whOamrsbEomY0UG5Ains0Hudg0h2CtqpTuahvLUs99BmaNj5SzbZPf         Vt9A==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mail-followup-to: zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Also adds support for NetBSD.
Suggestions are welcome for how to describe DragonFlyBSD's cache and
noscache flags.
- Matthew Martin
diff --git a/Completion/BSD/Command/_chflags b/Completion/BSD/Command/_chflags
index 8147df0..726d0fd 100644
--- a/Completion/BSD/Command/_chflags
+++ b/Completion/BSD/Command/_chflags
@@ -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
 
-  [[ $OSTYPE = freebsd* ]] && addflags \
-    offline offline \
-    rdonly readonly \
-    reparse 'Windows reparse point' \
-    sparse 'sparse file' \
-    system system
+  if [[ $OSTYPE = darwin* ]]; then
+    addflags hidden hidden
+  fi
+
+  if [[ $OSTYPE = (dragonfly|freebsd)* ]]; then
+    addlfags uunlnk 'user undeletable'
+    (( EUID )) || addflags sunlnk 'system undeletable'
+  fi
 
-  (( EUID )) || addflags sunlnk 'system undeletable'
+  [[ $OSTYPE = dragonflybsd* ]] && {
+    addflags \
+      cache XXX \
+      nouhistory 'user nohistory'
+
+    (( EUID )) || addflags \
+      noscache XXX \
+      noshistory 'system nohistory'
+  }
+
+  [[ $OSTYPE = freebsd* ]] && addflags \
+    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]"
Messages sorted by:
Reverse Date,
Date,
Thread,
Author