Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: In the tla completion function: "${(@P)var_cmd-*:FILE:_files}"
- X-seq: zsh-users 7896
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: In the tla completion function: "${(@P)var_cmd-*:FILE:_files}"
- Date: Fri, 20 Aug 2004 09:05:14 -0700 (PDT)
- In-reply-to: <20040820085546.GA1174@s>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20040816213204.GA6795@s> <20040817005205.GB2869@xxxxxxx> <20040820085546.GA1174@s>
- Reply-to: zsh-users@xxxxxxxxxx
On Fri, 20 Aug 2004, Haakon Riiser wrote:
> [Jason McCarty]
>
> > > if $var_cmd is not defined, I'd expect the expansion to give the
> > > string after the '-':
> >
> > $var_cmd is always defined to something of the form "cmd_*" on line 658.
>
> 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.
> % unset var_cmd
> % echo "${(@P)var_cmd-*:FILE:_files}"
> zsh: bad substitution
It is a little odd that ${(P)unset+full} and ${(P)unset-empty} don't both
give this error. Compare ${-empty} and ${:-empty} as well. In any case
the workaround is to use the ${(P)unset:-empty} form.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author