chshersh/iris

Implement switch parsers

chshersh opened this issue · 0 comments

optparse-applicative provides a switch parser with the following type:

switch :: Mod FlagFields Bool -> Parser Bool

It's not entirely clear what does the Bool mean: Is it True when the argument is enabled or when it's default?

I propose to introduce a helper parser in the Iris.Cli.OnOff module:

data OnOff
    = Off
    | On

onoff :: Mod FlagFields Bool -> Parser OnOff