gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] Fai update: now with shell mode


From: Jan Hudec
Subject: Re: [Gnu-arch-users] Fai update: now with shell mode
Date: Thu, 29 Jul 2004 10:07:27 +0200
User-agent: Mutt/1.5.6+20040523i

On Wed, Jul 28, 2004 at 20:24:28 -0400, Aaron Bentley wrote:
> Jan Hudec wrote:
> 
> >Yes, zsh completion for tla does exactly that. If the archive name is
> >already typed, there is no need to repeat it in the list of choices. And
> >fai shell does that, too. (In fact, if I try 'nget
> >address@hidden<Tab><Tab> in fai shell, I get '1 1-CHECK 1-MIRROR'
> >only).
> 
> In Fai, that's not a feature, it's a bug.  Completion in cmd.Cmd is 
> screwy when it comes to hyphens, so I have to add prefixes, find 
> completions, then chop 'em off.  But I can see how that's be a nice 
> thing to do on purpose.

Yes. But in zsh it's a feature. Zsh completion prints full archive names
as long as you are comleting an archive, but once / is there, it only
prints unqualified categories.

The idea with prefix really comes from the interface that zsh has for
the completions. The zsh interface is incredibly complicated, but this
one point seemed reasonable enough to make.

> >>>It's actualy a regular expression on tokens. So I would say:
> >>>package-versions ('--library'|'--full'|'--revisions')* <archive>
> >>>This is less human-readable, but more computer-readable.
> >>
> >>Considering the intended use, more human-readable is how I'd lean.
> >
> >
> >But you need to state whether order matters and where it does not.
> 
> Well, the only place I can see order mattering is with positional 
> parameters.  For options, the completion type is always "strings from 
> this list", and for option arguments, it's unambiguous.

Yes. But in the spec, you must somehow find what are positional
parameters, which may be optional, and what are options.

Eg. commit is one interesting thing in this respect. As perl6-regex, it
would be:
rule commitopt /<opt:A,archive> <archive>|<opt:D,dir> <dir> .../
rule commit /<t:commit> <commitopt>* <version>? [<t:--> <file>*]?/

As anything else, you need it to be espressive enough to say, that
before '--' there may be a single version, then there may be '--' and
then there may be any number of files.

-------------------------------------------------------------------------------
                                                 Jan 'Bulb' Hudec 
<address@hidden>

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]