The following patch adds escaping for the pipe character to
ocaml/xe-cli/bash-completion. This fixes the case where you want to
tab-complete a
VM name, and that VM name contains a pipe.
Signed-off-by: Ewan Mellor <ewan.mellor@xxxxxxxxxxxxx>
diff -r da740d604426 ocaml/xe-cli/bash-completion
--- a/ocaml/xe-cli/bash-completion Sat Jan 02 13:42:50 2010 +0000
+++ b/ocaml/xe-cli/bash-completion Wed Jan 13 14:17:51 2010 +0000
@@ -255,7 +255,7 @@
compgen_escape()
{
local v=$(echo "$2" | sed -e "s,',$MAGIC_SQUOTE,g" -e "s,\",$MAGIC_DQUOTE,g")
- compgen -W "$1" -- "$v" | sed -e 's, ,\\ ,g' -e 's,(,\\(,g' -e 's,),\\),g'
-e 's,$, ,g' -e "s,$MAGIC_SQUOTE,\\\',g" -e "s,$MAGIC_DQUOTE,\\\\\",g"
+ compgen -W "$1" -- "$v" | sed -e 's, ,\\ ,g' -e 's,(,\\(,g' -e 's,),\\),g'
-e 's,$, ,g' -e 's,|,\\|,g' -e "s,$MAGIC_SQUOTE,\\\',g" -e
"s,$MAGIC_DQUOTE,\\\\\",g"
}
params()
_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
|