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

Re: In the tla completion function: "${(@P)var_cmd-*:FILE:_files}"



[Bart Schaefer]

>> Hmm, strange that my shell gives 'bad substitution' when
>> var_cmd is not defined.

> So does Jason's, I'm sure.  Jason's point is that var_cmd should
> NEVER BE "not defined" in the _tla function.  It's defined at the
> point where it's declared, to be the second word on the command
> line.

OK, now I get it; the '-' fallback doesn't test var_cmd, but
the variable named by the expansion of $var_cmd:

  % unset foo
  % var_cmd=foo
  % echo "${(@P)var_cmd-*:FILE:_files}"
  *:FILE:_files

-- 
 Haakon



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