We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3d5ac5d commit 96bd60dCopy full SHA for 96bd60d
cforge/commands/resources/plugins.py
@@ -39,6 +39,12 @@ class _CaseInsensitiveEnum(str, Enum):
39
40
@classmethod
41
def _missing_(cls, value: object) -> Optional["_CaseInsensitiveEnum"]:
42
+ """Resolve unknown values by matching enum values case-insensitively.
43
+
44
+ Typer converts CLI strings into Enum members. Implementing `_missing_`
45
+ allows `--mode EnFoRcE` to resolve to `PluginMode.ENFORCE`, while still
46
+ rejecting unknown values.
47
+ """
48
if not isinstance(value, str):
49
return None
50
value_folded = value.casefold()
0 commit comments