[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-157-g10cfd72
Ville Skyttä
ville.skytta at iki.fi
Fri Apr 29 09:44:02 UTC 2011
The following commit has been merged in the master branch:
commit 7fb4e3137ddd1c0d265f830a74d34a9b6f07b8e5
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Fri Apr 29 12:05:29 2011 +0300
_parse_help: Don't treat tokens with more than two leading dashes as options.
diff --git a/bash_completion b/bash_completion
index 079497a..8f7d83f 100644
--- a/bash_completion
+++ b/bash_completion
@@ -759,6 +759,7 @@ _parse_help()
if ($i !~ /^-/) { break }
}
if (x == -1) { x = 1 }
+ if ($x ~ /^---/) { next }
if ($x ~ /^--?[[]no[]]./) {
y = $x ; sub("[[]no[]]", "", y)
z = $x ; sub("[[]no[]]", "no", z)
diff --git a/test/unit/_parse_help.exp b/test/unit/_parse_help.exp
index 64709c6..460c958 100644
--- a/test/unit/_parse_help.exp
+++ b/test/unit/_parse_help.exp
@@ -93,5 +93,9 @@ set cmd {fn() { printf '%s\n' "--[no]foo"; }; _parse_help fn}
assert_bash_list "--foo\n--nofoo" $cmd "long with \[no\]"
sync_after_int
+set cmd {fn() { printf '%s\n' "----\n---foo\n----- bar"; }; _parse_help fn}
+assert_bash_list "" $cmd "more than two dashes"
+sync_after_int
+
teardown
--
bash-completion
More information about the Bash-completion-commits
mailing list