[Bash-completion-commits] ./current r1128: * Merged Ubuntu changes:

David Paleino d.paleino at gmail.com
Mon Jun 23 09:03:01 UTC 2008


------------------------------------------------------------
revno: 1128
committer: David Paleino <d.paleino at gmail.com>
branch nick: current
timestamp: Mon 2008-06-23 11:03:01 +0200
message:
  * Merged Ubuntu changes:
    - added quote(), quote_readline(), dequote() helper functions.
modified:
  bash_completion
  debian/changelog
-------------- next part --------------
=== modified file 'bash_completion'
--- a/bash_completion	2008-06-22 19:42:22 +0000
+++ b/bash_completion	2008-06-23 09:03:01 +0000
@@ -188,6 +188,26 @@
     [[ "$( bind -v )" = *$1+([[:space:]])on* ]]
 }
 
+# This function shell-quotes the argument
+quote()
+{
+	echo \'${1//\'/\'\\\'\'}\' #'# Help vim syntax highlighting
+}
+
+# This function quotes the argument in a way so that readline dequoting 
+# results in the original argument
+quote_readline()
+{
+	local t="${1//\\/\\\\}"
+	echo \'${t//\'/\'\\\'\'}\' #'# Help vim syntax highlighting
+}
+
+# This function shell-dequotes the argument
+dequote()
+{
+	eval echo "$1"
+}
+
 # Get the word to complete
 # This is nicer than ${COMP_WORDS[$COMP_CWORD]}, since it handles cases
 # where the user is completing in the middle of a word.

=== modified file 'debian/changelog'
--- a/debian/changelog	2008-06-23 05:28:35 +0000
+++ b/debian/changelog	2008-06-23 09:03:01 +0000
@@ -1,3 +1,10 @@
+bash-completion (20080617.4) UNRELEASED; urgency=low
+
+  * Merged Ubuntu changes:
+    - added quote(), quote_readline(), dequote() helper functions.
+
+ -- David Paleino <d.paleino at gmail.com>  Mon, 23 Jun 2008 11:00:04 +0200
+
 bash-completion (20080617.3) unstable; urgency=low
 
   [ David Paleino ]



More information about the Bash-completion-commits mailing list