module Coda.Console.Options
( ConsoleOptions(..)
, HasConsoleOptions(..)
, parseConsoleOptions
) where
import Control.Lens
import Data.Default
import Data.Monoid ((<>))
import Options.Applicative as Options
data ConsoleOptions = ConsoleOptions
{ _consoleOptionsNoHeading :: Bool
, _consoleOptionsNoUnicode :: Bool
} deriving (Eq,Ord,Show,Read)
instance Default ConsoleOptions where
def = ConsoleOptions False False
parseConsoleOptions :: Options.Parser ConsoleOptions
parseConsoleOptions = ConsoleOptions
<$> switch (long "no-heading" <> help "Don't show a heading at the top of the REPL")
<*> switch (long "no-unicode" <> help "Disable code-page switching on windows")
makeClassy ''ConsoleOptions