25 lines
599 B
Haskell
25 lines
599 B
Haskell
|
|
{-|
|
||
|
|
Module: CAStore.Config.CLI
|
||
|
|
Description: Processes the command line of ca-store
|
||
|
|
-}
|
||
|
|
|
||
|
|
module CAStore.Config.CLI
|
||
|
|
( parseCLI
|
||
|
|
)
|
||
|
|
where
|
||
|
|
|
||
|
|
import CAStore.Config.Type (Config(..))
|
||
|
|
import CAStore.Type
|
||
|
|
import Data.Functor.Barbie (bsequence')
|
||
|
|
import Data.Functor.Identity (Identity(..))
|
||
|
|
import Options.Applicative hiding (command)
|
||
|
|
|
||
|
|
parseCLI :: IO (Config Identity)
|
||
|
|
parseCLI = execParser $ info (bsequence' parser) mempty
|
||
|
|
|
||
|
|
parser :: Config Parser
|
||
|
|
parser = Config
|
||
|
|
{ storeLocation = argument (maybeReader parseStoreLocation) (metavar "STORE")
|
||
|
|
, arguments = some (strArgument (metavar "COMMAND"))
|
||
|
|
}
|