Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: optional argument?



In article <200004190800.KAA04575@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
  Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx> writes:

> > I think `optional arguments' of _arguments doesn't work now.

> The problem is the `->' case: _arguments can't `add' matches for more
> than one `->state' because it doesn't add any of them.

I realized another problem.

Suppose following situation.

% _tst () { _arguments '-o::optarg:(optarg)' ':arg1:(arg1)' ':arg2:(arg2)' }
% tst -o xxx <TAB>

Because an argument for `-o' is optional, `xxx' is an argument for the
option or first non-option argument.  So, the word to be completed by
<TAB> is first non-option argument or second non-option argument.
Hence `arg1' and `arg2' should be completed.  But I think this is bit
confused and not so useful.
-- 
Tanaka Akira



Messages sorted by: Reverse Date, Date, Thread, Author