diff --git a/bash_completion b/bash_completion index b52f5a9c..ae20dc0f 100644 --- a/bash_completion +++ b/bash_completion @@ -759,7 +759,7 @@ _parse_help() if ($i !~ /^-/) { break } } if (x == -1) { x = 1 } - sub("[=<[].*", "", $x); + sub("[=<{[].*", "", $x); print $x }' } diff --git a/test/unit/_parse_help.exp b/test/unit/_parse_help.exp index 8803ffe7..6be5afb2 100644 --- a/test/unit/_parse_help.exp +++ b/test/unit/_parse_help.exp @@ -85,5 +85,9 @@ set cmd {fn() { printf '%s\n' "--foo="; }; _parse_help fn} assert_bash_list "--foo" $cmd "long with value in angle brackets" sync_after_int +set cmd {fn() { printf '%s\n' "--foo={bar,quux}"; }; _parse_help fn} +assert_bash_list "--foo" $cmd "long with value in curly brackets" +sync_after_int + teardown