1 {-# LANGUAGE TupleSections #-}
2 module Main (main) where
4 import System.Environment (getArgs)
6 import qualified Hcompta.CLI.Command as Command
7 import qualified Hcompta.CLI.Write as Write
8 import qualified Hcompta.CLI.Context as Context
9 import qualified Hcompta.CLI.Args as Args
13 (context, cmds) <- getArgs >>= Args.parse Context.nil Command.usage Command.options . (Context.nil,)
15 cmd:args -> Command.run context cmd args
16 [] -> Command.usage >>= Write.fatal context . ("one command is required\n" ++)