[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-380-g9e4605b

Ville Skyttä ville.skytta at iki.fi
Sat Jun 18 12:54:03 UTC 2011


The following commit has been merged in the master branch:
commit a52c4ea382814cb958cfd432d04ce6fc9f09a84f
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sat Jun 18 15:44:43 2011 +0300

    __parse_options: Remove trailing [().]* from completions.

diff --git a/bash_completion b/bash_completion
index 53f6264..4b7766f 100644
--- a/bash_completion
+++ b/bash_completion
@@ -703,12 +703,12 @@ __parse_options()
     # Expand --[no]foo to --foo and --nofoo etc
     if [[ $option =~ (\[((no|dont)-?)\]). ]]; then
         option2=${option/"${BASH_REMATCH[1]}"/}
-        option2=${option2%%[<{[]*}
+        option2=${option2%%[<{().[]*}
         printf '%s\n' "${option2/=*/=}"
         option=${option/"${BASH_REMATCH[1]}"/"${BASH_REMATCH[2]}"}
     fi
 
-    option=${option%%[<{[]*}
+    option=${option%%[<{().[]*}
     printf '%s\n' "${option/=*/=}"
 }
 
diff --git a/completions/mysql b/completions/mysql
index 646b531..319e273 100644
--- a/completions/mysql
+++ b/completions/mysql
@@ -59,8 +59,7 @@ _mysql()
 
     case $cur in
         --*)
-            # TODO: fix _parse_help
-            local help=$(_parse_help "$1"|sed -e 's/[.)]*$//')
+            local help=$(_parse_help "$1")
             help+=" --skip-comment --skip-ssl"
 
             COMPREPLY=( $( compgen -W "$help" -- "$cur" ) )
diff --git a/test/unit/_parse_help.exp b/test/unit/_parse_help.exp
index ef28d41..c087562 100644
--- a/test/unit/_parse_help.exp
+++ b/test/unit/_parse_help.exp
@@ -121,5 +121,9 @@ set cmd {fn() { printf '%s\n' "-f [FOO], --foo[=FOO]"; }; _parse_help fn}
 assert_bash_list "--foo" $cmd "-f \[FOO\], --foo\[=FOO\]"
 sync_after_int
 
+set cmd {fn() { printf '%s\n' "--foo."; }; _parse_help fn}
+assert_bash_list "--foo" $cmd "--foo."
+sync_after_int
+
 
 teardown

-- 
bash-completion



More information about the Bash-completion-commits mailing list