Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Default tags in _arguments and some more ...
- X-seq: zsh-workers 10720
- From: "Andrej Borsenkow" <Andrej.Borsenkow@xxxxxxxxxxxxxx>
- To: "ZSH workers mailing list" <zsh-workers@xxxxxxxxxxxxxx>
- Subject: Default tags in _arguments and some more ...
- Date: Thu, 13 Apr 2000 10:35:18 +0400
- Importance: Normal
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
For file arguments - is it possible to specify default set of patterns
that can be overridden using styles? More general - is there easy way to
assign a tag inside _arguments description? What I mean, is something
like
-I::compressed files:*.gz\:"compressed-files\:compressed-files"
with the effect, that tag name ``compressed-files'' with default pattern
*.gz is used when completing argument of -I option. More general,
something like
-F[file system type]::file system type:fsys-type(ufs vxfs)
that would use tag ``fsys-type'' when completing arguments of -F option.
As I understand, currently the latter is impossible (_inline_ - of
course, using states everything is possible), and the former is limited
to calling _files with patterns that will assign all patterns to
globbed-files.
There are a couple more issues I do not much like
- special usage of blanks; it is way too easy to accidentally miss ot
misplace them
- very strict syntax for values. It is hard to add something new (as we
have seen recently) and every new addition may be incompatible.
So, here is suggestion that may be useful:
use flags to define semantic values. Something like
...:::[l]foo bar baz - for literal list of values
...:::[e]a shell string - for eval'ed string
etc
This has a major advantage of being extensible without breaking existing
usage. And we can easily define new flags like
...:::[p]*.gz *.Z - for file patterns; or even
...:::[p]*.gz:gzip-file *.Z:compressed-files - using the same syntax as
for styles;
...:::[t/weird-tag/]... - use tag `weird-tag' when completing these
values
-andrej
Have a nice DOS!
B >>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author