You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classApp {
@Option(names = "-a", groups = "ALL") booleana;
@Option(names = "-b", groups = "ALL") booleanb;
}
CommandLine.populate(newArgs(), "-a -b"); // NOT "-a", "-b" !
Gives this cryptic error message:
UnmatchedArgumentException: Unknown option: - -b
The parser takes this as a POSIX clustered option group, matches the "-a" part, then tries and fails to match the remainder " -b" (with leading space) by prefixing with a - and going through the logic in processClusteredShortOptions again. This results in the surprising error message.
One option to improve this is to add the original option cluster in the error message.
The text was updated successfully, but these errors were encountered:
remkop
changed the title
Improve error message for invalid input "-a -b" (one arg)
Improve error message for unknown options while processing clustered short options
Feb 16, 2019
How to reproduce:
Gives this cryptic error message:
The parser takes this as a POSIX clustered option group, matches the
"-a"
part, then tries and fails to match the remainder" -b"
(with leading space) by prefixing with a-
and going through the logic inprocessClusteredShortOptions
again. This results in the surprising error message.One option to improve this is to add the original option cluster in the error message.
The text was updated successfully, but these errors were encountered: