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

How about separating "_arguments --" into a new function?



Not sure this was discussed before or not:

_gnu_generic works rather well for basenc, and '_arguments --'
caches the option specs generated from the --help text in a variable
_args_cache_basenc. So I created _basenc by

% compdef _gnu_generic basenc
% basenc <TAB>
% echo ${(F)${(qqq)_args_cache_basenc}} > _basenc
and edited _basenc (to add option groups etc.).

If we separate the part of _arguments that generates the option specs
(around lines 36 - 323) into an auto-loadable function, say help2specs,
then we will be able to do something like

% help2specs cmd > _cmd
(and edit _cmd to improve it)

If this seems useful I'll work on it.
Or just using $_args_cache_cmd is enough?

If _arguments is separated into two, tracing the history by 'git blame'
etc. would be a little bit tedious.





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