_parse_help: Treat " or " as a separator when parsing options.
This commit is contained in:
parent
525d6e77ba
commit
102a19c8a2
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user