zsh-users
 help / color / mirror / code / Atom feed
* In the tla completion function: "${(@P)var_cmd-*:FILE:_files}"
@ 2004-08-16 21:32 Haakon Riiser
  2004-08-17  0:52 ` Jason McCarty
  0 siblings, 1 reply; 5+ messages in thread
From: Haakon Riiser @ 2004-08-16 21:32 UTC (permalink / raw)
  To: zsh-users

I was just browsing through the new completion function for tla
in zsh 4.2.1, and I was wondering about the expression shown in
the subject:

  "${(@P)var_cmd-*:FILE:_files}"

>From what I've read in the manual, I'd guess that the @ flag is
a harmless bug that has no effect since $var_cmd is not an array,
and that the P flag makes the expression expand to the expansion of
the variable name contained in $var_cmd, if $var_cmd is defined;
if $var_cmd is not defined, I'd expect the expansion to give the
string after the '-':

  *:FILE:_files

I tried it out in an interactive session, but the '-' expansion
doesn't work.

  ##
  ## This works:
  ##
  % myvar=hello
  % foo=myvar
  % echo "${(@P)foo-bar}"
  hello

  ##
  ## This does not:
  ##
  % unset foo
  % echo "${(@P)foo-bar}"
  zsh: bad substitution

Is this a bug in the completion file that has gone unnoticed
because var_cmd has always been defined?

-- 
 Haakon


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-08-20 16:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-16 21:32 In the tla completion function: "${(@P)var_cmd-*:FILE:_files}" Haakon Riiser
2004-08-17  0:52 ` Jason McCarty
2004-08-20  8:55   ` Haakon Riiser
2004-08-20 16:05     ` Bart Schaefer
2004-08-20 16:40       ` Haakon Riiser

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).