_parse_help: Fix --foo={bar,quux} handling.

This commit is contained in:
Ville Skyttä 2011-04-28 12:47:52 +03:00
parent efeb1a22dd
commit fd2bd342e0
2 changed files with 5 additions and 1 deletions

View File

@ -759,7 +759,7 @@ _parse_help()
if ($i !~ /^-/) { break }
}
if (x == -1) { x = 1 }
sub("[=<[].*", "", $x);
sub("[=<{[].*", "", $x);
print $x
}'
}

View File

@ -85,5 +85,9 @@ set cmd {fn() { printf '%s\n' "--foo=<bar>"; }; _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