From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1377 invoked from network); 2 Aug 2001 20:31:54 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 2 Aug 2001 20:31:54 -0000 Received: (qmail 6998 invoked by alias); 2 Aug 2001 20:31:45 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15563 Received: (qmail 6980 invoked from network); 2 Aug 2001 20:31:42 -0000 Date: Thu, 02 Aug 2001 22:25:49 +0900 Message-ID: <86snfak2zm.wl@archon.local.idaemons.org> From: "Akinori MUSHA" To: Oliver Kiddle Cc: zsh-workers@sunsite.dk Subject: Re: _chflags In-Reply-To: <3B6945AD.AFDEA069@yahoo.co.uk> References: <864rrrvd3m.wl@archon.local.idaemons.org> <3B6945AD.AFDEA069@yahoo.co.uk> User-Agent: Wanderlust/2.7.1 (Too Funky) SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (=?ISO-8859-1?Q?Unebigory=F2mae?=) APEL/10.3 MULE XEmacs/21.1 (patch 14) (Cuyahoga Valley) (i386--freebsd) Organization: Associated I. Daemons X-PGP-Public-Key: finger knu@FreeBSD.org X-PGP-Fingerprint: 081D 099C 1705 861D 4B70 B04A 920B EFC7 9FD9 E1EE MIME-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII At Thu, 02 Aug 2001 13:21:01 +0100, Oliver Kiddle wrote: > I'll add that (and the _sysctl change). > > Is the nodump flag defintely turned off with nonodump then (as opposed > to just dump)? > > According to the man page you referenced, the flags are specified as a > comma separated list so I would suggest you replace the flags= and > compadd lines with something like: > > _values -s , 'file flag' > {no,}{arch,opaque,nodump,sappnd,schg,sunlnk,uappnd,uchg,uunlnk} > > but if descriptions for the flags might be useful, you could use things > like: > '(noarch)arch[set archived]' to _values. > It would be nice to use _arguments for the options. Are the options > different on net/openbsd or different versions of FreeBSD? Do they all > use the comma separated list of flags? Ah, OK, I'm getting the hang of it. Every point you addressed above is correct. Now what about the attached one? :) And I have a couple of questions: 1. How can I prevent _values from sorting the values? 2. How can I let zsh automatically add `R' when one chooses -[LHP]? Thanks, -- / /__ __ Akinori.org / MUSHA.org / ) ) ) ) / FreeBSD.org / Ruby-lang.org Akinori MUSHA aka / (_ / ( (__( @ iDaemons.org / and.or.jp "Freeze this moment a little bit longer, make each impression a little bit stronger.. Experience slips away -- Time stand still" #compdef chflags (( $+functions[__chflags] )) || __chflags() { if [[ CURRENT -eq 2 || $words[CURRENT-1] = -* ]]; then case $OSTYPE in freebsd*) _values -s , 'file flags' \ '(noarch)arch[set the archived flag (super-user only)]' \ '(arch)noarch[unset the archived flag (super-user only)]' \ '(noopaque)opaque[set the opaque flag (owner or super-user only)]' \ '(opaque)noopaque[unset the opaque flag (owner or super-user only)]' \ '(dump)nodump[set the nodump flag (owner or super-user only)]' \ '(nodump)dump[unset the nodump flag (owner or super-user only)]' \ '(nosappnd)sappnd[set the system append-only flag (super-user only)]' \ '(sappnd)nosappnd[unset the system append-only flag (super-user only)]' \ '(noschg)schg[set the system immutable flag (super-user only)]' \ '(schg)noschg[unset the system immutable flag (super-user only)]' \ '(nosunlnk)sunlnk[set the system undeletable flag (super-user only)]' \ '(sunlnk)nosunlnk[unset the system undeletable flag (super-user only)]' \ '(nouappnd)uappnd[set the user append-only flag (owner or super-user only)]' \ '(uappnd)nouappnd[unset the user append-only flag (owner or super-user only)]' \ '(nouchg)uchg[set the user immutable flag (owner or super-user only)]' \ '(uchg)nouchg[unset the user immutable flag (owner or super-user only)]' \ '(nouunlnk)uunlnk[set the user undeletable flag (owner or super-user only)]' \ '(uunlnk)nouunlnk[unset the user undeletable flag (owner or super-user only)]' ;; netbsd*|openbsd*) _values -s , 'file flags' \ '(noarch)arch[set the archived flag (super-user only)]' \ '(arch)noarch[unset the archived flag (super-user only)]' \ '(noopaque)opaque[set the opaque flag (owner or super-user only)]' \ '(opaque)noopaque[unset the opaque flag (owner or super-user only)]' \ '(dump)nodump[set the nodump flag (owner or super-user only)]' \ '(nodump)dump[unset the nodump flag (owner or super-user only)]' \ '(nosappnd)sappnd[set the system append-only flag (super-user only)]' \ '(sappnd)nosappnd[unset the system append-only flag (super-user only)]' \ '(noschg)schg[set the system immutable flag (super-user only)]' \ '(schg)noschg[unset the system immutable flag (super-user only)]' \ '(nouappnd)uappnd[set the user append-only flag (owner or super-user only)]' \ '(uappnd)nouappnd[unset the user append-only flag (owner or super-user only)]' \ '(nouchg)uchg[set the user immutable flag (owner or super-user only)]' \ '(uchg)nouchg[unset the user immutable flag (owner or super-user only)]' ;; esac else _files 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 direcotries]' \ '*:flags and files:__chflags'