[Bash-completion-devel] phing completion review

Elan Ruusamäe glen at delfi.ee
Sun Mar 27 18:52:24 UTC 2011


On Sat, Mar 26, 2011 at 18:01, Raph <gibboris at gmail.com> wrote:

> On Sat, Mar 26, 2011 at 03:51:32PM +0200, Elan Ruusamäe wrote:
> > hi please review phing completion:
> >
> >
> https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=312910&group_id=100114
> >
>
> I didn't test it but it seems quite nice to me.
> But I don't understand the sed trickery (and my GNU sed 4.2.1 does not
> complains)
>
> I don't remember the bash completion policies about the GNU sed
> extensions but, if allowed, wouldn't the following be ok ?
> $ sed -nE "/<target /s/.*name=[\"'](\w+)[\"'].*/\1/p" $buildfile
> otherwise
> $ sed -ne "/<target /s/.*name=[\"']\([a-zA-Z0-9]\+\)[\"'].*/\1/p"
> $buildfile
>

that target name extraction is identical to completions/ant,
and ant is in git, so should be fine for phing too:

sed -ne 's/.*<target .*name="\([^"]*\).*/\1/p'

here's no trickery, imho pretty standard
"take-anything-between-double-quotes-and-print-it" pattern

-- 
glen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/bash-completion-devel/attachments/20110327/c0d377c8/attachment.htm>


More information about the Bash-completion-devel mailing list