<div class="gmail_quote">On Sat, Mar 26, 2011 at 18:01, Raph <span dir="ltr"><<a href="mailto:gibboris@gmail.com">gibboris@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Sat, Mar 26, 2011 at 03:51:32PM +0200, Elan Ruusamäe wrote:<br>
> hi please review phing completion:<br>
><br>
> <a href="https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=312910&group_id=100114" target="_blank">https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=312910&group_id=100114</a><br>
><br>
<br>
</div>I didn't test it but it seems quite nice to me.<br>
But I don't understand the sed trickery (and my GNU sed 4.2.1 does not<br>
complains)<br>
<br>
I don't remember the bash completion policies about the GNU sed<br>
extensions but, if allowed, wouldn't the following be ok ?<br>
$ sed -nE "/<target /s/.*name=[\"'](\w+)[\"'].*/\1/p" $buildfile<br>
otherwise<br>
$ sed -ne "/<target /s/.*name=[\"']\([a-zA-Z0-9]\+\)[\"'].*/\1/p" $buildfile<br></blockquote><div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>that target name extraction is identical to completions/ant,</div>
<div>and ant is in git, so should be fine for phing too:</div></div><div><br></div><div>sed -ne 's/.*<target .*name="\([^"]*\).*/\1/p'</div><div><br></div><div>here's no trickery, imho pretty standard "take-anything-between-double-quotes-and-print-it" pattern</div>
<div><br></div><div>-- </div><div>glen</div></div>