[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-399-g1daff31

Ville Skyttä ville.skytta at iki.fi
Sun Jul 10 12:29:42 UTC 2011


The following commit has been merged in the master branch:
commit 102a19c8a29e80e34b83391fa473e8c3d4cf582d
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sun Jul 10 15:25:23 2011 +0300

    _parse_help: Treat " or " as a separator when parsing options.

diff --git a/bash_completion b/bash_completion
index eae72eb..6c3cd73 100644
--- a/bash_completion
+++ b/bash_completion
@@ -728,7 +728,7 @@ _parse_help()
             ((^|[^-])-[A-Za-z0-9?][[:space:]]+)\[?[A-Z0-9]+\]? ]]; do
             line=${line/"${BASH_REMATCH[0]}"/"${BASH_REMATCH[1]}"}
         done
-        __parse_options "$line"
+        __parse_options "${line// or /, }"
 
     done
 }
diff --git a/test/unit/_parse_help.exp b/test/unit/_parse_help.exp
index c087562..a6d58d5 100644
--- a/test/unit/_parse_help.exp
+++ b/test/unit/_parse_help.exp
@@ -125,5 +125,9 @@ set cmd {fn() { printf '%s\n' "--foo."; }; _parse_help fn}
 assert_bash_list "--foo" $cmd "--foo."
 sync_after_int
 
+set cmd {fn() { printf '%s\n' "-f or --foo"; }; _parse_help fn}
+assert_bash_list "--foo" $cmd "-f or --foo"
+sync_after_int
+
 
 teardown

-- 
bash-completion



More information about the Bash-completion-commits mailing list