{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} module Hcompta.CLI.Context where import Hcompta.CLI.Lang data App = App data Context = Context { verbosity :: Verbosity , command :: String , color :: Maybe Bool , lang :: Lang } deriving (Show) context :: IO Context context = do lang <- get_lang return $ Context { verbosity = Verbosity_Info , command = "" , color = Nothing , lang } data Verbosity = Verbosity_Error | Verbosity_Warn | Verbosity_Info | Verbosity_Debug deriving (Bounded, Enum, Eq, Ord, Show)