-
Notifications
You must be signed in to change notification settings - Fork 290
Open
Description
Enum parsing is currently case-sensitive, which makes sense because C# is case-sensitive, but I think we might be able to make the parsing less particular about case and make things a little more intuitive. I'd be willing to do a PR if the powers that be are cool with it. I can think of 2 options off the top of my head:
- Allow all lower case values to be parsed.
- Allow the user to explicitly specify which parameter values get mapped to which enum members, e.g.
public enum MyEnum
{
[ParseArgument("valueone", "VALUEONE")]
ValueOne
}
While there's nothing stopping someone from defining 2 enum members which only differ by case, it's probably a dumb thing to do so. In either case, it's difficult to 100% guarantee that the parsing will work for all cases b/c of case-sensitivity, but it should improve things for the overwhelming majority of use cases.
Let me know if either of these designs (or a combination of both) are appealing.
Metadata
Metadata
Assignees
Labels
No labels