core: Throw an exception when both GREEDY and QUOTED are specified for a StringArgument
This commit is contained in:
parent
1bed15ea6d
commit
c78c4aba08
1 changed files with 5 additions and 0 deletions
|
|
@ -136,6 +136,11 @@ public final class StandardParserRegistry<C> implements ParserRegistry<C> {
|
|||
this.registerParserSupplier(TypeToken.get(String.class), options -> {
|
||||
final boolean greedy = options.get(StandardParameters.GREEDY, false);
|
||||
final boolean quoted = options.get(StandardParameters.QUOTED, false);
|
||||
if (greedy && quoted) {
|
||||
throw new IllegalArgumentException(
|
||||
"Don't know whether to create GREEDY or QUOTED StringArgument.StringParser, both specified."
|
||||
);
|
||||
}
|
||||
final StringArgument.StringMode stringMode;
|
||||
if (greedy) {
|
||||
stringMode = StringArgument.StringMode.GREEDY;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue