1 {-# LANGUAGE AllowAmbiguousTypes #-}
2 {-# LANGUAGE OverloadedStrings #-}
3 {-# LANGUAGE NoMonomorphismRestriction #-}
4 {-# LANGUAGE TypeApplications #-}
5 {-# LANGUAGE NamedFieldPuns #-}
6 {-# OPTIONS_GHC -Wno-missing-signatures #-}
7 module Hjugement.CLI where
9 import Control.Applicative (Applicative(..), Alternative(..))
10 import Control.Monad (Monad(..))
12 import Data.Either (Either(..))
13 import Data.Function (($), (.))
14 import Data.Functor ((<$>), (<$))
16 import Data.List.NonEmpty (NonEmpty(..))
17 import Data.Maybe (Maybe(..), fromMaybe)
18 import Data.Ord (Ord(..))
19 import Data.Semigroup (Semigroup(..))
20 import Data.String (String)
21 import Data.Text (Text)
22 import Data.Void (Void)
23 import Symantic.CLI as CLI
24 import System.Environment (getArgs)
25 import System.IO (IO, FilePath, print, stderr, putStrLn)
26 import Text.Show (Show(..))
27 import Type.Reflection (Typeable)
28 import qualified Data.Set as Set
29 import qualified Data.Text as Text
30 import qualified Data.Text.Lazy.IO as TL
31 import qualified Data.Version as Version
32 import qualified Paths_hjugement_cli as Hjugement
33 import qualified Symantic.Document as Doc
34 import qualified System.IO as IO
36 import Hjugement.CLI.Utils
37 import Hjugement.CLI.Administrator
38 import Hjugement.CLI.Registrar
39 import Hjugement.CLI.Trustee
40 import Hjugement.CLI.Voter
43 progname = "hjugement"
47 (api_options <?> api_agent) <!>
62 run_administrator params :!:
63 run_trustee params :!:
64 run_registrar params :!:
70 tag (TagLong "version") nothing
73 return (Doc.from version <> Doc.newline)
77 Text.pack (Version.showVersion Hjugement.version)
79 parseAPI = parser @Void @Doc api run