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

Re: _arguments parsing of --help output



Bart Schaefer wrote:

> Many GNU commands include short options in the --help output as well as long
> ones; e.g. `tar --help' emits lines like "-m, --modifcation-time ...".  The
> code in _arguments accounts for this by splitting the line at commas, but
> then discards the short form of the option.
> 
> Is there a reason that we don't attempt to complete the short forms as well?

The only problem I can see is if the user-supplied specs contain those 
options, too. Currently _arguments does not discard additional
definitions but the first one takes precedence with respect to
argument handling (arguments of options):

  _arguments '-e:ea:(1 2)' -e -b -p

This will make `foo -e <TAB>' complete `1' and `2' but `foo -' lists
both (with auto-descriptions).

Hm, maybe we should do something about that.

The code in _arguments takes care that the user-supplied specs are
preferred over the automatically derived ones, though.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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