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

Re: PATCH: completion



In article <199908231346.PAA03326@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
  Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx> writes:

>   '-opt:*::descr:action'                # all args to the option

Does this require the actual option?

I tried to use this for first non-option argument. But it does not work.

Z(2):akr@is27e1u11% ./Src/zsh -f
is27e1u11% bindkey -e; fpath=($PWD/Completion/*(/)); autoload -U compinit; compinit -D; compdef _tst tst
is27e1u11% compconf group_matches=yes
is27e1u11% compconf message_format='%d'
is27e1u11% compconf description_format='%d'
is27e1u11% _tst () { _arguments '-x' ':*::mesg:_tst2' }
is27e1u11% _tst2 () { compadd "$words" }
is27e1u11% tst -x <TAB>

->

is27e1u11% tst -x tst\ -x\  

So, _arguments doesn't cut off words in this case.

I think words should be an empty list (or a singleton list contains
an empty string) in _tst2.

I found this problem with new _cvs implementation.

_cvs () { # "+Qqrwtnlvb:T:e:d:Hfz:s:xa"
  _arguments -s \
    -{a,f,H,l,n,Q,q,r,t,v,w,x} \
    '--version' '--help' '--help-commands' '--help-synonyms' '--help-options' \
    ...
    '-z:gzip level:_cvs_gzip_level' \
    ':*:cvs command:_cvs_command'
}
-- 
Tanaka Akira



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