From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@sunsite.dk
Subject: Re: In the tla completion function: "${(@P)var_cmd-*:FILE:_files}"
Date: Fri, 20 Aug 2004 09:05:14 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.61.0408200842470.27591@toltec.zanshin.com> (raw)
In-Reply-To: <20040820085546.GA1174@s>
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.
next prev parent reply other threads:[~2004-08-20 16:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-16 21:32 Haakon Riiser
2004-08-17 0:52 ` Jason McCarty
2004-08-20 8:55 ` Haakon Riiser
2004-08-20 16:05 ` Bart Schaefer [this message]
2004-08-20 16:40 ` Haakon Riiser
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.61.0408200842470.27591@toltec.zanshin.com \
--to=schaefer@brasslantern.com \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).