]> Git — Sourcephile - comptalang.git/blob - cli/Hcompta/CLI/Context.hs
Ajout : Lib.Interval{,.Sieve} : pour Filter.Reduce.
[comptalang.git] / cli / Hcompta / CLI / Context.hs
1 {-# LANGUAGE NamedFieldPuns #-}
2 {-# LANGUAGE FlexibleInstances #-}
3 {-# LANGUAGE OverloadedStrings #-}
4 module Hcompta.CLI.Context where
5
6 import Hcompta.CLI.Lang
7
8 data App = App
9
10 data Context
11 = Context
12 { verbosity :: Verbosity
13 , command :: String
14 , color :: Maybe Bool
15 , lang :: Lang
16 } deriving (Show)
17
18 context :: IO Context
19 context = do
20 lang <- get_lang
21 return $
22 Context
23 { verbosity = Verbosity_Info
24 , command = ""
25 , color = Nothing
26 , lang
27 }
28
29 data Verbosity
30 = Verbosity_Error
31 | Verbosity_Warn
32 | Verbosity_Info
33 | Verbosity_Debug
34 deriving (Bounded, Enum, Eq, Ord, Show)
35