1 {-# LANGUAGE OverloadedStrings #-}
2 {-# LANGUAGE TupleSections #-}
3 module Main (main) where
5 import qualified Data.Text.Lazy as TL
7 import System.Environment (getArgs)
9 import qualified Hcompta.CLI.Args as Args
10 import qualified Hcompta.CLI.Command as Command
11 import qualified Hcompta.CLI.Context as Context
12 import qualified Hcompta.CLI.Write as Write
13 import qualified Hcompta.Lib.Leijen as W
14 import Hcompta.Lib.Leijen ((<>))
19 context <- Context.context
20 getArgs >>= Args.parse
26 cmd:args -> Command.run context cmd args
28 >>= Write.fatal context .
29 ((W.text "one command is required" <> W.line) <>) .