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

Re: dumb completion question

Andy Spiegl wrote:
> > If you have extendedglob set, you need to qutoe '^clusters' or it will
> > expand to all files apart from one called clusters
> aaaargh!
> I didn't have it set but "setopt no_extendedglob" did help.

It's on by default in completion functions.  I would get used to having
it on and quote accordingly.  If you must turn it off, use
"setopt localoptions" or "emulate -L zsh" to prevent the change escaping
from the function.

> However, it still doesn't work correctly.
>  % cssh <TAB>
>  % cssh \(\ all\ www\ fire\ db\ mail\ web\ rest\)

Now I look, the problem is another quoting problem:

 definedclusters="($(grep ^clusters $HOME/.csshrc | cut -d= -f2- 2>/dev/null))"

You're assigning the string starting "(" and ending ")", not an array.
In full, you want

 definedclusters=($(grep '^clusters' $HOME/.csshrc | cut -d= -f2- 2>/dev/null))

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


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