WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH] Fix handling of pipes in bash-completion

To: Xen-API <xen-api@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-API] [PATCH] Fix handling of pipes in bash-completion
From: Ewan Mellor <ewan.mellor@xxxxxxxxxxxxx>
Date: Wed, 13 Jan 2010 16:21:34 +0200
Delivery-date: Wed, 13 Jan 2010 06:37:26 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.18 (2008-05-17)
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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-API] [PATCH] Fix handling of pipes in bash-completion, Ewan Mellor <=