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

This commit is contained in:
Ville Skyttä 2011-07-10 15:25:23 +03:00
parent 525d6e77ba
commit 102a19c8a2
2 changed files with 5 additions and 1 deletions

View File

@ -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
}

View File

@ -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