zsh-workers
 help / color / mirror / code / Atom feed
From: "Akinori MUSHA" <knu@iDaemons.org>
To: Oliver Kiddle <okiddle@yahoo.co.uk>
Cc: zsh-workers@sunsite.dk
Subject: Re: _chflags
Date: Thu, 02 Aug 2001 22:25:49 +0900	[thread overview]
Message-ID: <86snfak2zm.wl@archon.local.idaemons.org> (raw)
In-Reply-To: <3B6945AD.AFDEA069@yahoo.co.uk>

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'


  reply	other threads:[~2001-08-02 20:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-01 18:39 _chflags Akinori MUSHA
2001-08-02 12:21 ` _chflags Oliver Kiddle
2001-08-02 13:25   ` Akinori MUSHA [this message]
2001-08-02 16:19     ` _chflags Oliver Kiddle
2001-08-02 17:40       ` _chflags Akinori MUSHA
2001-08-03 11:46         ` _chflags Oliver Kiddle
2001-08-03  8:25       ` _chflags Sven Wischnowsky
2001-08-06 11:36         ` grouping inverses and sorting in completion lists (was _chflags) Oliver Kiddle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86snfak2zm.wl@archon.local.idaemons.org \
    --to=knu@idaemons.org \
    --cc=okiddle@yahoo.co.uk \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).