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
I have a --debug flag and rather than litter my codebase with conditionals on a boolean I want to have this return Debug.Console when set and otherwise have a default of Debug.Disabled. As far as I can tell, this isn't supported by flag().
I first looked at mutuallyExclusiveOptions(option("--debug").convert { Debug.Console }).default(Debug.Disabled), but this fails to compile as at least two options are required.
Thankfully I found option().switch<Debug>(mapOf("--debug" to Debug.Console)).default(Debug.Disabled), although it took a while.
Is it worth putting a convert extension onto FlagOption?
The text was updated successfully, but these errors were encountered:
I have a
--debug
flag and rather than litter my codebase with conditionals on a boolean I want to have this returnDebug.Console
when set and otherwise have a default ofDebug.Disabled
. As far as I can tell, this isn't supported byflag()
.I first looked at
mutuallyExclusiveOptions(option("--debug").convert { Debug.Console }).default(Debug.Disabled)
, but this fails to compile as at least two options are required.Thankfully I found
option().switch<Debug>(mapOf("--debug" to Debug.Console)).default(Debug.Disabled)
, although it took a while.Is it worth putting a
convert
extension ontoFlagOption
?The text was updated successfully, but these errors were encountered: