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

Arguments splitting (was: RE: PATCH: _cd not completing in $cdpath)



> _alternative re-evaluates arguments passed to it, so a string like
>  '\(/home/pws /home/pws/tex\)'
> isn't good enough as a path for _path_files -W because it gets split on
> spaces, whereas _path_files needs it as a single argument.  If that's the
> correct behaviour for _alternative --- and I suspect it is, because there
> are uses like
>   _alternative 'files:: _files' 'parameters:: _parameters'
> --- then _cd needs fixing.
>

It is correct, that arguments, that are command line, need splitting (to get at
this command line at all :-) But the current way to split them prevents any
arguments with embedded LFS characters.

What about something like

eval "action=( $action )"

Then we could define

_alternative 'files::_files -W "(a b c)"'

i.e. just use usual quoting.

Note, that this (possibly - I did not check the code) applies to _arguments,
_values etc - to any function, that is possibly using this format. It seems that
a single utility function/builtin to habdle such arguments is quite timely.

/andrej



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