Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug#355430: zsh: acroread completion prints debugging information
- X-seq: zsh-workers 22386
- From: Clint Adams <clint@xxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Bug#355430: zsh: acroread completion prints debugging information
- Date: Sun, 26 Mar 2006 10:12:06 -0500
- Cc: zsh-workers@xxxxxxxxxx, 355430@xxxxxxxxxxxxxxx, Jay Berkenbilt <qjb@xxxxxxxxxx>
- In-reply-to: <060325230122.ZM6731@xxxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, zsh-workers@xxxxxxxxxx, 355430@xxxxxxxxxxxxxxx, Jay Berkenbilt <qjb@xxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20060305163923.12356.23913.reportbug@xxxxxxxxxxxxx> <20060306020302.GA6489@xxxxxxxxxxx> <20060325095217.2524443157.qww314159@xxxxxxxxxxxxx> <20060325151155.GA21370@xxxxxxxxxxx> <060325101546.ZM21762@xxxxxxxxxxxxxxxxxxxxxx> <20060325183407.GA19421@xxxxxxxxxxx> <060325230122.ZM6731@xxxxxxxxxxxxxxxxxxxxxx>
> That doesn't seem to be it either. E.g.:
>
> schaefer<502> print -R ver=${${${(f)"$(</dev/null)"}:#^ver=*}##ver=}
> ver=
% emulate -R zsh
% print -R paco ver=${${${(f)"$(</home/clint/bin/acroread)"}:#^ver=*}##ver=}
paco ver=#!/bin/sh exec /usr/local/bin/acroread "$@"
% setopt extendedglob
% print -R paco ver=${${${(f)"$(</home/clint/bin/acroread)"}:#^ver=*}##ver=}
paco ver=
% setopt rcexpandparam
% print -R paco ver=${${${(f)"$(</home/clint/bin/acroread)"}:#^ver=*}##ver=}
paco
> } +local ver=${${${(f)"$(<$commands[$words[1]])"}:#(#s)ver=*}##ver=}
>
> ... does not work for me at all. The "^" does not mean "anchor at
> beginning", it means "do NOT match the following pattern". What's
> really wanted is:
>
> local ver=${${${(Mf)"$(<$commands[$words[1]])"}:#ver=*}##ver=}
Aha.
Index: Completion/X/Command/_acroread
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/X/Command/_acroread,v
retrieving revision 1.5
diff -u -r1.5 _acroread
--- Completion/X/Command/_acroread 10 May 2005 12:26:24 -0000 1.5
+++ Completion/X/Command/_acroread 26 Mar 2006 15:04:18 -0000
@@ -4,12 +4,12 @@
# Try extracting the version number directly from the executable.
# (This will fail if the executable is a wrapper script for acroread.)
-local ver=${${${(f)"$(<$commands[$words[1]])"}:#^ver=*}##ver=}
+local ver=${${${(Mf)"$(<$commands[$words[1]])"}:#ver=*}##ver=}
[[ -n $ver ]] && _acroread_version=$ver
if (( ! $+_acroread_version )); then
local acropath=${${(s. .)${${(f)"$($words[1] -help 2>&1)"}[1]}}[2]}
- _acroread_version=${${${(f)"$(<$acropath)"}:#^ver=*}##ver=}
+ _acroread_version=${${${(Mf)"$(<$acropath)"}:#ver=*}##ver=}
fi
if [[ $_acroread_version == 7.* ]]; then
Messages sorted by:
Reverse Date,
Date,
Thread,
Author