Closed CaryCatZ closed 1 month ago
@CaryCatZ Thank you for reporting this issue. While it is arguable whether it is a good idea to provide a user-friendly name here (see https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#toString-- which says that this is intended to be the declared name of the constant), I think this is simply a bug. So I would kindly encourage you to provide a PR containing a fix and a unit test proving its effect.
Thanks for considering this issue and the PR will be provided soon.
The formatter uses
Enum::toString
to print. But parse usesEnum::name
to match. So, you might typeX
but it says it's invalid but alsoX
is an allowed value in the help. This may happen whentoString
method was overrode.For example: The enumeration is:
The help may be like this:
So, the user might type
-res 4K
But the program gave this unthinkable report:
Invalid value for -res parameter. Allowed values: [4K, 1080P, 720P]