module Hix.Options where
import Options.Applicative (
CommandFields,
Mod,
Parser,
bashCompleter,
command,
completer,
customExecParser,
fullDesc,
header,
help,
helper,
hsubparser,
info,
long,
option,
prefs,
progDesc,
short,
showHelpOnEmpty,
showHelpOnError,
strOption,
switch,
value,
)
import Path (Abs, Dir, File, Path, SomeBase, parseRelDir, parseSomeDir)
import Path.IO (getCurrentDir)
import Prelude hiding (Mod, mod)
import qualified Hix.Data.BootstrapProjectConfig
import Hix.Data.BootstrapProjectConfig (BootstrapProjectConfig (BootstrapProjectConfig))
import Hix.Data.ComponentConfig (
ComponentName (ComponentName),
EnvName,
ModuleName,
PackageName (PackageName),
SourceDir (SourceDir),
)
import Hix.Data.GhciConfig (ChangeDir (ChangeDir), EnvConfig, GhciConfig, RunnerName)
import qualified Hix.Data.NewProjectConfig
import Hix.Data.NewProjectConfig (NewProjectConfig (NewProjectConfig))
import Hix.Data.PreprocConfig (PreprocConfig)
import Hix.Optparse (JsonConfig, absDirOption, absFileOption, jsonOption)
data PreprocOptions =
PreprocOptions {
PreprocOptions -> Maybe (Either PreprocConfig JsonConfig)
config :: Maybe (Either PreprocConfig JsonConfig),
PreprocOptions -> Maybe (Path Abs Dir)
root :: Maybe (Path Abs Dir),
PreprocOptions -> Path Abs File
source :: Path Abs File,
PreprocOptions -> Path Abs File
inFile :: Path Abs File,
PreprocOptions -> Path Abs File
outFile :: Path Abs File
}
deriving stock (Int -> PreprocOptions -> ShowS
[PreprocOptions] -> ShowS
PreprocOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PreprocOptions] -> ShowS
$cshowList :: [PreprocOptions] -> ShowS
show :: PreprocOptions -> String
$cshow :: PreprocOptions -> String
showsPrec :: Int -> PreprocOptions -> ShowS
$cshowsPrec :: Int -> PreprocOptions -> ShowS
Show, forall x. Rep PreprocOptions x -> PreprocOptions
forall x. PreprocOptions -> Rep PreprocOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PreprocOptions x -> PreprocOptions
$cfrom :: forall x. PreprocOptions -> Rep PreprocOptions x
Generic)
data PackageSpec =
PackageSpec {
PackageSpec -> PackageName
name :: PackageName,
PackageSpec -> Maybe (SomeBase Dir)
dir :: Maybe (SomeBase Dir)
}
deriving stock (PackageSpec -> PackageSpec -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PackageSpec -> PackageSpec -> Bool
$c/= :: PackageSpec -> PackageSpec -> Bool
== :: PackageSpec -> PackageSpec -> Bool
$c== :: PackageSpec -> PackageSpec -> Bool
Eq, Int -> PackageSpec -> ShowS
[PackageSpec] -> ShowS
PackageSpec -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PackageSpec] -> ShowS
$cshowList :: [PackageSpec] -> ShowS
show :: PackageSpec -> String
$cshow :: PackageSpec -> String
showsPrec :: Int -> PackageSpec -> ShowS
$cshowsPrec :: Int -> PackageSpec -> ShowS
Show, forall x. Rep PackageSpec x -> PackageSpec
forall x. PackageSpec -> Rep PackageSpec x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PackageSpec x -> PackageSpec
$cfrom :: forall x. PackageSpec -> Rep PackageSpec x
Generic)
data ComponentSpec =
ComponentSpec {
ComponentSpec -> ComponentName
name :: ComponentName,
ComponentSpec -> Maybe SourceDir
dir :: Maybe SourceDir
}
deriving stock (ComponentSpec -> ComponentSpec -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComponentSpec -> ComponentSpec -> Bool
$c/= :: ComponentSpec -> ComponentSpec -> Bool
== :: ComponentSpec -> ComponentSpec -> Bool
$c== :: ComponentSpec -> ComponentSpec -> Bool
Eq, Int -> ComponentSpec -> ShowS
[ComponentSpec] -> ShowS
ComponentSpec -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComponentSpec] -> ShowS
$cshowList :: [ComponentSpec] -> ShowS
show :: ComponentSpec -> String
$cshow :: ComponentSpec -> String
showsPrec :: Int -> ComponentSpec -> ShowS
$cshowsPrec :: Int -> ComponentSpec -> ShowS
Show, forall x. Rep ComponentSpec x -> ComponentSpec
forall x. ComponentSpec -> Rep ComponentSpec x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ComponentSpec x -> ComponentSpec
$cfrom :: forall x. ComponentSpec -> Rep ComponentSpec x
Generic)
data ComponentCoords =
ComponentCoords {
ComponentCoords -> Maybe PackageSpec
package :: Maybe PackageSpec,
ComponentCoords -> Maybe ComponentSpec
component :: Maybe ComponentSpec
}
deriving stock (ComponentCoords -> ComponentCoords -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComponentCoords -> ComponentCoords -> Bool
$c/= :: ComponentCoords -> ComponentCoords -> Bool
== :: ComponentCoords -> ComponentCoords -> Bool
$c== :: ComponentCoords -> ComponentCoords -> Bool
Eq, Int -> ComponentCoords -> ShowS
[ComponentCoords] -> ShowS
ComponentCoords -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComponentCoords] -> ShowS
$cshowList :: [ComponentCoords] -> ShowS
show :: ComponentCoords -> String
$cshow :: ComponentCoords -> String
showsPrec :: Int -> ComponentCoords -> ShowS
$cshowsPrec :: Int -> ComponentCoords -> ShowS
Show, forall x. Rep ComponentCoords x -> ComponentCoords
forall x. ComponentCoords -> Rep ComponentCoords x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ComponentCoords x -> ComponentCoords
$cfrom :: forall x. ComponentCoords -> Rep ComponentCoords x
Generic)
data TargetSpec =
TargetForFile (Path Abs File)
|
TargetForComponent ComponentCoords
deriving stock (TargetSpec -> TargetSpec -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TargetSpec -> TargetSpec -> Bool
$c/= :: TargetSpec -> TargetSpec -> Bool
== :: TargetSpec -> TargetSpec -> Bool
$c== :: TargetSpec -> TargetSpec -> Bool
Eq, Int -> TargetSpec -> ShowS
[TargetSpec] -> ShowS
TargetSpec -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TargetSpec] -> ShowS
$cshowList :: [TargetSpec] -> ShowS
show :: TargetSpec -> String
$cshow :: TargetSpec -> String
showsPrec :: Int -> TargetSpec -> ShowS
$cshowsPrec :: Int -> TargetSpec -> ShowS
Show, forall x. Rep TargetSpec x -> TargetSpec
forall x. TargetSpec -> Rep TargetSpec x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TargetSpec x -> TargetSpec
$cfrom :: forall x. TargetSpec -> Rep TargetSpec x
Generic)
data TestOptions =
TestOptions {
TestOptions -> ModuleName
mod :: ModuleName,
TestOptions -> Maybe Text
test :: Maybe Text,
TestOptions -> Maybe RunnerName
runner :: Maybe RunnerName,
TestOptions -> ChangeDir
cd :: ChangeDir
}
deriving stock (TestOptions -> TestOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TestOptions -> TestOptions -> Bool
$c/= :: TestOptions -> TestOptions -> Bool
== :: TestOptions -> TestOptions -> Bool
$c== :: TestOptions -> TestOptions -> Bool
Eq, Int -> TestOptions -> ShowS
[TestOptions] -> ShowS
TestOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TestOptions] -> ShowS
$cshowList :: [TestOptions] -> ShowS
show :: TestOptions -> String
$cshow :: TestOptions -> String
showsPrec :: Int -> TestOptions -> ShowS
$cshowsPrec :: Int -> TestOptions -> ShowS
Show, forall x. Rep TestOptions x -> TestOptions
forall x. TestOptions -> Rep TestOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TestOptions x -> TestOptions
$cfrom :: forall x. TestOptions -> Rep TestOptions x
Generic)
data EnvRunnerOptions =
EnvRunnerOptions {
EnvRunnerOptions -> Either EnvConfig JsonConfig
config :: Either EnvConfig JsonConfig,
EnvRunnerOptions -> Maybe (Path Abs Dir)
root :: Maybe (Path Abs Dir),
EnvRunnerOptions -> Maybe TargetSpec
component :: Maybe TargetSpec
}
deriving stock (Int -> EnvRunnerOptions -> ShowS
[EnvRunnerOptions] -> ShowS
EnvRunnerOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnvRunnerOptions] -> ShowS
$cshowList :: [EnvRunnerOptions] -> ShowS
show :: EnvRunnerOptions -> String
$cshow :: EnvRunnerOptions -> String
showsPrec :: Int -> EnvRunnerOptions -> ShowS
$cshowsPrec :: Int -> EnvRunnerOptions -> ShowS
Show, forall x. Rep EnvRunnerOptions x -> EnvRunnerOptions
forall x. EnvRunnerOptions -> Rep EnvRunnerOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EnvRunnerOptions x -> EnvRunnerOptions
$cfrom :: forall x. EnvRunnerOptions -> Rep EnvRunnerOptions x
Generic)
newtype =
Text
deriving stock (ExtraGhciOptions -> ExtraGhciOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExtraGhciOptions -> ExtraGhciOptions -> Bool
$c/= :: ExtraGhciOptions -> ExtraGhciOptions -> Bool
== :: ExtraGhciOptions -> ExtraGhciOptions -> Bool
$c== :: ExtraGhciOptions -> ExtraGhciOptions -> Bool
Eq, Int -> ExtraGhciOptions -> ShowS
[ExtraGhciOptions] -> ShowS
ExtraGhciOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExtraGhciOptions] -> ShowS
$cshowList :: [ExtraGhciOptions] -> ShowS
show :: ExtraGhciOptions -> String
$cshow :: ExtraGhciOptions -> String
showsPrec :: Int -> ExtraGhciOptions -> ShowS
$cshowsPrec :: Int -> ExtraGhciOptions -> ShowS
Show, forall x. Rep ExtraGhciOptions x -> ExtraGhciOptions
forall x. ExtraGhciOptions -> Rep ExtraGhciOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExtraGhciOptions x -> ExtraGhciOptions
$cfrom :: forall x. ExtraGhciOptions -> Rep ExtraGhciOptions x
Generic)
deriving newtype (String -> ExtraGhciOptions
forall a. (String -> a) -> IsString a
fromString :: String -> ExtraGhciOptions
$cfromString :: String -> ExtraGhciOptions
IsString)
newtype =
Text
deriving stock (ExtraGhcidOptions -> ExtraGhcidOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExtraGhcidOptions -> ExtraGhcidOptions -> Bool
$c/= :: ExtraGhcidOptions -> ExtraGhcidOptions -> Bool
== :: ExtraGhcidOptions -> ExtraGhcidOptions -> Bool
$c== :: ExtraGhcidOptions -> ExtraGhcidOptions -> Bool
Eq, Int -> ExtraGhcidOptions -> ShowS
[ExtraGhcidOptions] -> ShowS
ExtraGhcidOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExtraGhcidOptions] -> ShowS
$cshowList :: [ExtraGhcidOptions] -> ShowS
show :: ExtraGhcidOptions -> String
$cshow :: ExtraGhcidOptions -> String
showsPrec :: Int -> ExtraGhcidOptions -> ShowS
$cshowsPrec :: Int -> ExtraGhcidOptions -> ShowS
Show, forall x. Rep ExtraGhcidOptions x -> ExtraGhcidOptions
forall x. ExtraGhcidOptions -> Rep ExtraGhcidOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExtraGhcidOptions x -> ExtraGhcidOptions
$cfrom :: forall x. ExtraGhcidOptions -> Rep ExtraGhcidOptions x
Generic)
deriving newtype (String -> ExtraGhcidOptions
forall a. (String -> a) -> IsString a
fromString :: String -> ExtraGhcidOptions
$cfromString :: String -> ExtraGhcidOptions
IsString)
data GhciOptions =
GhciOptions {
GhciOptions -> Either GhciConfig JsonConfig
config :: Either GhciConfig JsonConfig,
GhciOptions -> Maybe (Path Abs Dir)
root :: Maybe (Path Abs Dir),
GhciOptions -> TargetSpec
component :: TargetSpec,
GhciOptions -> TestOptions
test :: TestOptions,
:: Maybe ExtraGhciOptions
}
deriving stock (Int -> GhciOptions -> ShowS
[GhciOptions] -> ShowS
GhciOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GhciOptions] -> ShowS
$cshowList :: [GhciOptions] -> ShowS
show :: GhciOptions -> String
$cshow :: GhciOptions -> String
showsPrec :: Int -> GhciOptions -> ShowS
$cshowsPrec :: Int -> GhciOptions -> ShowS
Show, forall x. Rep GhciOptions x -> GhciOptions
forall x. GhciOptions -> Rep GhciOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GhciOptions x -> GhciOptions
$cfrom :: forall x. GhciOptions -> Rep GhciOptions x
Generic)
data GhcidOptions =
GhcidOptions {
GhcidOptions -> GhciOptions
ghci :: GhciOptions,
:: Maybe ExtraGhcidOptions
}
deriving stock (Int -> GhcidOptions -> ShowS
[GhcidOptions] -> ShowS
GhcidOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GhcidOptions] -> ShowS
$cshowList :: [GhcidOptions] -> ShowS
show :: GhcidOptions -> String
$cshow :: GhcidOptions -> String
showsPrec :: Int -> GhcidOptions -> ShowS
$cshowsPrec :: Int -> GhcidOptions -> ShowS
Show, forall x. Rep GhcidOptions x -> GhcidOptions
forall x. GhcidOptions -> Rep GhcidOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GhcidOptions x -> GhcidOptions
$cfrom :: forall x. GhcidOptions -> Rep GhcidOptions x
Generic)
data NewOptions =
NewOptions {
NewOptions -> NewProjectConfig
config :: NewProjectConfig
}
deriving stock (NewOptions -> NewOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NewOptions -> NewOptions -> Bool
$c/= :: NewOptions -> NewOptions -> Bool
== :: NewOptions -> NewOptions -> Bool
$c== :: NewOptions -> NewOptions -> Bool
Eq, Int -> NewOptions -> ShowS
[NewOptions] -> ShowS
NewOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NewOptions] -> ShowS
$cshowList :: [NewOptions] -> ShowS
show :: NewOptions -> String
$cshow :: NewOptions -> String
showsPrec :: Int -> NewOptions -> ShowS
$cshowsPrec :: Int -> NewOptions -> ShowS
Show, forall x. Rep NewOptions x -> NewOptions
forall x. NewOptions -> Rep NewOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NewOptions x -> NewOptions
$cfrom :: forall x. NewOptions -> Rep NewOptions x
Generic)
data BootstrapOptions =
BootstrapOptions {
BootstrapOptions -> BootstrapProjectConfig
config :: BootstrapProjectConfig
}
deriving stock (BootstrapOptions -> BootstrapOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BootstrapOptions -> BootstrapOptions -> Bool
$c/= :: BootstrapOptions -> BootstrapOptions -> Bool
== :: BootstrapOptions -> BootstrapOptions -> Bool
$c== :: BootstrapOptions -> BootstrapOptions -> Bool
Eq, Int -> BootstrapOptions -> ShowS
[BootstrapOptions] -> ShowS
BootstrapOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BootstrapOptions] -> ShowS
$cshowList :: [BootstrapOptions] -> ShowS
show :: BootstrapOptions -> String
$cshow :: BootstrapOptions -> String
showsPrec :: Int -> BootstrapOptions -> ShowS
$cshowsPrec :: Int -> BootstrapOptions -> ShowS
Show, forall x. Rep BootstrapOptions x -> BootstrapOptions
forall x. BootstrapOptions -> Rep BootstrapOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BootstrapOptions x -> BootstrapOptions
$cfrom :: forall x. BootstrapOptions -> Rep BootstrapOptions x
Generic)
data EnvRunnerCommandOptions =
EnvRunnerCommandOptions {
EnvRunnerCommandOptions -> EnvRunnerOptions
options :: EnvRunnerOptions,
EnvRunnerCommandOptions -> TestOptions
test :: TestOptions
}
deriving stock (Int -> EnvRunnerCommandOptions -> ShowS
[EnvRunnerCommandOptions] -> ShowS
EnvRunnerCommandOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnvRunnerCommandOptions] -> ShowS
$cshowList :: [EnvRunnerCommandOptions] -> ShowS
show :: EnvRunnerCommandOptions -> String
$cshow :: EnvRunnerCommandOptions -> String
showsPrec :: Int -> EnvRunnerCommandOptions -> ShowS
$cshowsPrec :: Int -> EnvRunnerCommandOptions -> ShowS
Show, forall x. Rep EnvRunnerCommandOptions x -> EnvRunnerCommandOptions
forall x. EnvRunnerCommandOptions -> Rep EnvRunnerCommandOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EnvRunnerCommandOptions x -> EnvRunnerCommandOptions
$cfrom :: forall x. EnvRunnerCommandOptions -> Rep EnvRunnerCommandOptions x
Generic)
data Command =
Preproc PreprocOptions
|
EnvRunner EnvRunnerCommandOptions
|
GhcidCmd GhcidOptions
|
GhciCmd GhciOptions
|
NewCmd NewOptions
|
BootstrapCmd BootstrapOptions
deriving stock (Int -> Command -> ShowS
[Command] -> ShowS
Command -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Command] -> ShowS
$cshowList :: [Command] -> ShowS
show :: Command -> String
$cshow :: Command -> String
showsPrec :: Int -> Command -> ShowS
$cshowsPrec :: Int -> Command -> ShowS
Show)
data GlobalOptions =
GlobalOptions {
GlobalOptions -> Maybe Bool
verbose :: Maybe Bool,
GlobalOptions -> Path Abs Dir
cwd :: Path Abs Dir
}
deriving stock (GlobalOptions -> GlobalOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GlobalOptions -> GlobalOptions -> Bool
$c/= :: GlobalOptions -> GlobalOptions -> Bool
== :: GlobalOptions -> GlobalOptions -> Bool
$c== :: GlobalOptions -> GlobalOptions -> Bool
Eq, Int -> GlobalOptions -> ShowS
[GlobalOptions] -> ShowS
GlobalOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GlobalOptions] -> ShowS
$cshowList :: [GlobalOptions] -> ShowS
show :: GlobalOptions -> String
$cshow :: GlobalOptions -> String
showsPrec :: Int -> GlobalOptions -> ShowS
$cshowsPrec :: Int -> GlobalOptions -> ShowS
Show, forall x. Rep GlobalOptions x -> GlobalOptions
forall x. GlobalOptions -> Rep GlobalOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GlobalOptions x -> GlobalOptions
$cfrom :: forall x. GlobalOptions -> Rep GlobalOptions x
Generic)
data Options =
Options {
Options -> GlobalOptions
global :: GlobalOptions,
Options -> Command
cmd :: Command
}
deriving stock (Int -> Options -> ShowS
[Options] -> ShowS
Options -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Options] -> ShowS
$cshowList :: [Options] -> ShowS
show :: Options -> String
$cshow :: Options -> String
showsPrec :: Int -> Options -> ShowS
$cshowsPrec :: Int -> Options -> ShowS
Show)
fileParser ::
String ->
String ->
Parser (Path Abs File)
fileParser :: String -> String -> Parser (Path Abs File)
fileParser String
longName String
helpText =
forall a. ReadM a -> Mod OptionFields a -> Parser a
option ReadM (Path Abs File)
absFileOption (forall (f :: * -> *) a. HasName f => String -> Mod f a
long String
longName forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. HasCompleter f => Completer -> Mod f a
completer (String -> Completer
bashCompleter String
"file") forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. String -> Mod f a
help String
helpText)
rootParser :: Parser (Maybe (Path Abs Dir))
rootParser :: Parser (Maybe (Path Abs Dir))
rootParser =
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional (forall a. ReadM a -> Mod OptionFields a -> Parser a
option ReadM (Path Abs Dir)
absDirOption (forall (f :: * -> *) a. HasName f => String -> Mod f a
long String
"root" forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. String -> Mod f a
help String
"The root directory of the project"))
jsonConfigParser ::
Parser JsonConfig
jsonConfigParser :: Parser JsonConfig
jsonConfigParser =
forall a. ReadM a -> Mod OptionFields a -> Parser a
option ReadM JsonConfig
jsonOption (forall (f :: * -> *) a. HasName f => String -> Mod f a
long String
"config" forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. String -> Mod f a
help String
"The Hix-generated config, file or text")
preprocParser :: Parser PreprocOptions
preprocParser :: Parser PreprocOptions
preprocParser =
Maybe (Either PreprocConfig JsonConfig)
-> Maybe (Path Abs Dir)
-> Path Abs File
-> Path Abs File
-> Path Abs File
-> PreprocOptions
PreprocOptions
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>
(forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a b. b -> Either a b
Right forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser JsonConfig
jsonConfigParser)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*>
Parser (Maybe (Path Abs Dir))
rootParser
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*>
String -> String -> Parser (Path Abs File)
fileParser String
"source" String
"The original source file"
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*>
String -> String -> Parser (Path Abs File)
fileParser String
"in" String
"The prepared input file"
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*>
String -> String -> Parser (Path Abs File)
fileParser String
"out" String
"The path to the output file"
packageSpecParser :: Parser (Maybe PackageSpec)
packageSpecParser :: Parser (Maybe PackageSpec)
packageSpecParser = do
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional (forall s. IsString s => Mod OptionFields s -> Parser s
strOption (forall (f :: * -> *) a. HasName f => String -> Mod f a
long String
"package" forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. HasName f => Char -> Mod f a
short Char
'p' forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. String -> Mod f a
help String
"The name or directory of the test package")) forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap \ Text
name ->
PackageSpec {$sel:name:PackageSpec :: PackageName
name = Text -> PackageName
PackageName Text
name, $sel:dir:PackageSpec :: Maybe (SomeBase Dir)
dir = forall (m :: * -> *). MonadThrow m => String -> m (SomeBase Dir)
parseSomeDir (forall a. ToString a => a -> String
toString Text
name)}
componentSpecParser :: Parser (Maybe ComponentSpec)
componentSpecParser :: Parser (Maybe ComponentSpec)
componentSpecParser = do
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional (forall s. IsString s => Mod OptionFields s -> Parser s
strOption (forall (f :: * -> *) a. HasName f => String -> Mod f a
long String
"component" forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. HasName f => Char -> Mod f a
short Char
'c' forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. String -> Mod f a
help String
h)) forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap \ Text
name ->
ComponentSpec {$sel:name:ComponentSpec :: ComponentName
name = Text -> ComponentName
ComponentName Text
name, $sel:dir:ComponentSpec :: Maybe SourceDir
dir = Path Rel Dir -> SourceDir
SourceDir forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall (m :: * -> *). MonadThrow m => String -> m (Path Rel Dir)
parseRelDir (forall a. ToString a => a -> String
toString Text
name)}
where
h :: String
h = String
"The name or relative directory of the test component"
componentCoordsParser :: Parser ComponentCoords
componentCoordsParser :: Parser ComponentCoords
componentCoordsParser =
Maybe PackageSpec -> Maybe ComponentSpec -> ComponentCoords
ComponentCoords
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>
Parser (Maybe PackageSpec)
packageSpecParser
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*>
Parser (Maybe ComponentSpec)
componentSpecParser
componentForFileParser :: Parser TargetSpec
componentForFileParser :: Parser TargetSpec
componentForFileParser =
Path Abs File -> TargetSpec
TargetForFile
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>
forall a. ReadM a -> Mod OptionFields a -> Parser a
option ReadM (Path Abs File)
absFileOption (forall (f :: * -> *) a. HasName f => String -> Mod f a
long String
"file" forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. HasName f => Char -> Mod f a
short Char
'f' forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. String -> Mod f a
help String
"The absolute file path of the test module")
targetSpecParser :: Parser TargetSpec
targetSpecParser :: Parser TargetSpec
targetSpecParser =
Parser TargetSpec
componentForFileParser
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|>
ComponentCoords -> TargetSpec
TargetForComponent forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser ComponentCoords
componentCoordsParser
envNameParser :: Parser EnvName
envNameParser :: Parser EnvName
envNameParser =
forall s. IsString s => Mod OptionFields s -> Parser s
strOption (forall (f :: * -> *) a. HasName f => String -> Mod f a
long String
"env" forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. HasName f => Char -> Mod f a
short Char
'e' forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. String -> Mod f a
help String
"The name of the environment")
testParser :: Parser (Maybe Text)
testParser :: Parser (Maybe Text)
testParser =
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional (forall s. IsString s => Mod OptionFields s -> Parser s
strOption (forall (f :: * -> *) a. HasName f => String -> Mod f a
long String
"test" forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. HasName f => Char -> Mod f a
short Char
't' forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. String -> Mod f a
help String
"The Haskell function that should be executed"))
runnerParser :: Parser (Maybe RunnerName)
runnerParser :: Parser (Maybe RunnerName)
runnerParser =
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional (forall s. IsString s => Mod OptionFields s -> Parser s
strOption (
forall (f :: * -> *) a. HasName f => String -> Mod f a
long String
"run"
forall a. Semigroup a => a -> a -> a
<>
forall (f :: * -> *) a. HasName f => Char -> Mod f a
short Char
'r'
forall a. Semigroup a => a -> a -> a
<>
forall (f :: * -> *) a. String -> Mod f a
help String
"The name of the command defined in the Hix option 'ghci.run'"
))
cdParser :: Parser ChangeDir
cdParser :: Parser ChangeDir
cdParser =
Bool -> ChangeDir
ChangeDir forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Bool
not forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Mod FlagFields Bool -> Parser Bool
switch (forall (f :: * -> *) a. HasName f => String -> Mod f a
long String
"no-cd" forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. String -> Mod f a
help String
"Don't change the working directory to the package root")
moduleParser :: Parser ModuleName
moduleParser :: Parser ModuleName
moduleParser =
forall s. IsString s => Mod OptionFields s -> Parser s
strOption (forall (f :: * -> *) a. HasName f => String -> Mod f a
long String
"module" forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. HasName f => Char -> Mod f a
short Char
'm' forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. String -> Mod f a
help String
"The module containing the test function" forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. HasValue f => a -> Mod f a
value ModuleName
"Main")
testOptionsParser :: Parser TestOptions
testOptionsParser :: Parser TestOptions
testOptionsParser = do
Maybe Text
test <- Parser (Maybe Text)
testParser
Maybe RunnerName
runner <- Parser (Maybe RunnerName)
runnerParser
ModuleName
mod <- Parser ModuleName
moduleParser
ChangeDir
cd <- Parser ChangeDir
cdParser
pure TestOptions {Maybe Text
Maybe RunnerName
ModuleName
ChangeDir
cd :: ChangeDir
mod :: ModuleName
runner :: Maybe RunnerName
test :: Maybe Text
$sel:cd:TestOptions :: ChangeDir
$sel:runner:TestOptions :: Maybe RunnerName
$sel:test:TestOptions :: Maybe Text
$sel:mod:TestOptions :: ModuleName
..}
extraGhciParser :: Parser (Maybe ExtraGhciOptions)
=
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional (forall s. IsString s => Mod OptionFields s -> Parser s
strOption (forall (f :: * -> *) a. HasName f => String -> Mod f a
long String
"ghci-options" forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. String -> Mod f a
help String
"Additional command line options to pass to ghci"))
extraGhcidParser :: Parser (Maybe ExtraGhcidOptions)
=
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional (forall s. IsString s => Mod OptionFields s -> Parser s
strOption (forall (f :: * -> *) a. HasName f => String -> Mod f a
long String
"ghcid-options" forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. String -> Mod f a
help String
"Additional command line options to pass to ghcid"))
envParser :: Parser EnvRunnerCommandOptions
envParser :: Parser EnvRunnerCommandOptions
envParser = do
EnvRunnerOptions
options <- do
Either EnvConfig JsonConfig
config <- forall a b. b -> Either a b
Right forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser JsonConfig
jsonConfigParser
Maybe (Path Abs Dir)
root <- Parser (Maybe (Path Abs Dir))
rootParser
Maybe TargetSpec
component <- forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser TargetSpec
targetSpecParser
pure EnvRunnerOptions {Maybe (Path Abs Dir)
Maybe TargetSpec
Either EnvConfig JsonConfig
component :: Maybe TargetSpec
root :: Maybe (Path Abs Dir)
config :: Either EnvConfig JsonConfig
$sel:component:EnvRunnerOptions :: Maybe TargetSpec
$sel:root:EnvRunnerOptions :: Maybe (Path Abs Dir)
$sel:config:EnvRunnerOptions :: Either EnvConfig JsonConfig
..}
TestOptions
test <- Parser TestOptions
testOptionsParser
pure EnvRunnerCommandOptions {EnvRunnerOptions
TestOptions
test :: TestOptions
options :: EnvRunnerOptions
$sel:test:EnvRunnerCommandOptions :: TestOptions
$sel:options:EnvRunnerCommandOptions :: EnvRunnerOptions
..}
ghciParser :: Parser GhciOptions
ghciParser :: Parser GhciOptions
ghciParser = do
Either GhciConfig JsonConfig
config <- forall a b. b -> Either a b
Right forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser JsonConfig
jsonConfigParser
Maybe (Path Abs Dir)
root <- Parser (Maybe (Path Abs Dir))
rootParser
TargetSpec
component <- Parser TargetSpec
targetSpecParser
TestOptions
test <- Parser TestOptions
testOptionsParser
Maybe ExtraGhciOptions
extra <- Parser (Maybe ExtraGhciOptions)
extraGhciParser
pure GhciOptions {Maybe (Path Abs Dir)
Maybe ExtraGhciOptions
Either GhciConfig JsonConfig
TestOptions
TargetSpec
extra :: Maybe ExtraGhciOptions
test :: TestOptions
component :: TargetSpec
root :: Maybe (Path Abs Dir)
config :: Either GhciConfig JsonConfig
$sel:extra:GhciOptions :: Maybe ExtraGhciOptions
$sel:test:GhciOptions :: TestOptions
$sel:component:GhciOptions :: TargetSpec
$sel:root:GhciOptions :: Maybe (Path Abs Dir)
$sel:config:GhciOptions :: Either GhciConfig JsonConfig
..}
ghcidParser :: Parser GhcidOptions
ghcidParser :: Parser GhcidOptions
ghcidParser = do
GhciOptions
ghci <- Parser GhciOptions
ghciParser
Maybe ExtraGhcidOptions
extra <- Parser (Maybe ExtraGhcidOptions)
extraGhcidParser
pure GhcidOptions {Maybe ExtraGhcidOptions
GhciOptions
extra :: Maybe ExtraGhcidOptions
ghci :: GhciOptions
$sel:extra:GhcidOptions :: Maybe ExtraGhcidOptions
$sel:ghci:GhcidOptions :: GhciOptions
..}
newParser :: Parser NewOptions
newParser :: Parser NewOptions
newParser = do
ProjectName
name <- forall s. IsString s => Mod OptionFields s -> Parser s
strOption (forall (f :: * -> *) a. HasName f => String -> Mod f a
long String
"name" forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. HasName f => Char -> Mod f a
short Char
'n' forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. String -> Mod f a
help String
"The name of the new project and its main package")
Bool
packages <- Mod FlagFields Bool -> Parser Bool
switch (forall (f :: * -> *) a. HasName f => String -> Mod f a
long String
"packages" forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. HasName f => Char -> Mod f a
short Char
'p' forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. String -> Mod f a
help String
"Store packages in the 'packages/' subdirectory")
HixUrl
hixUrl <- forall s. IsString s => Mod OptionFields s -> Parser s
strOption (forall (f :: * -> *) a. HasName f => String -> Mod f a
long String
"hix-url" forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. String -> Mod f a
help String
"The URL to the Hix repository" forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. HasValue f => a -> Mod f a
value forall a. Default a => a
def)
Author
author <- forall s. IsString s => Mod OptionFields s -> Parser s
strOption (forall (f :: * -> *) a. HasName f => String -> Mod f a
long String
"author" forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. HasName f => Char -> Mod f a
short Char
'a' forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. String -> Mod f a
help String
"Your name" forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. HasValue f => a -> Mod f a
value Author
"Author")
pure NewOptions {$sel:config:NewOptions :: NewProjectConfig
config = NewProjectConfig {Bool
Author
HixUrl
ProjectName
$sel:author:NewProjectConfig :: Author
$sel:hixUrl:NewProjectConfig :: HixUrl
$sel:packages:NewProjectConfig :: Bool
$sel:name:NewProjectConfig :: ProjectName
author :: Author
hixUrl :: HixUrl
packages :: Bool
name :: ProjectName
..}}
bootstrapParser :: Parser BootstrapOptions
bootstrapParser :: Parser BootstrapOptions
bootstrapParser = do
HixUrl
hixUrl <- forall s. IsString s => Mod OptionFields s -> Parser s
strOption (forall (f :: * -> *) a. HasName f => String -> Mod f a
long String
"hix-url" forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. String -> Mod f a
help String
"The URL to the Hix repository" forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. HasValue f => a -> Mod f a
value forall a. Default a => a
def)
pure BootstrapOptions {$sel:config:BootstrapOptions :: BootstrapProjectConfig
config = BootstrapProjectConfig {HixUrl
$sel:hixUrl:BootstrapProjectConfig :: HixUrl
hixUrl :: HixUrl
..}}
commands :: Mod CommandFields Command
commands :: Mod CommandFields Command
commands =
forall a. String -> ParserInfo a -> Mod CommandFields a
command String
"preproc" (PreprocOptions -> Command
Preproc forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Parser a -> InfoMod a -> ParserInfo a
info Parser PreprocOptions
preprocParser (forall a. String -> InfoMod a
progDesc String
"Preprocess a source file for use with ghcid"))
forall a. Semigroup a => a -> a -> a
<>
forall a. String -> ParserInfo a -> Mod CommandFields a
command String
"env" (EnvRunnerCommandOptions -> Command
EnvRunner forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Parser a -> InfoMod a -> ParserInfo a
info Parser EnvRunnerCommandOptions
envParser (forall a. String -> InfoMod a
progDesc String
"Print the env runner for a component or a named env"))
forall a. Semigroup a => a -> a -> a
<>
forall a. String -> ParserInfo a -> Mod CommandFields a
command String
"ghci-cmd" (GhciOptions -> Command
GhciCmd forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Parser a -> InfoMod a -> ParserInfo a
info Parser GhciOptions
ghciParser (forall a. String -> InfoMod a
progDesc String
"Print a ghci cmdline to load a module in a Hix env"))
forall a. Semigroup a => a -> a -> a
<>
forall a. String -> ParserInfo a -> Mod CommandFields a
command String
"ghcid-cmd" (GhcidOptions -> Command
GhcidCmd forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Parser a -> InfoMod a -> ParserInfo a
info Parser GhcidOptions
ghcidParser (forall a. String -> InfoMod a
progDesc String
"Print a ghcid cmdline to run a function in a Hix env"))
forall a. Semigroup a => a -> a -> a
<>
forall a. String -> ParserInfo a -> Mod CommandFields a
command String
"new" (NewOptions -> Command
NewCmd forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Parser a -> InfoMod a -> ParserInfo a
info Parser NewOptions
newParser (forall a. String -> InfoMod a
progDesc String
"Create a new Hix project in the current directory"))
forall a. Semigroup a => a -> a -> a
<>
forall a. String -> ParserInfo a -> Mod CommandFields a
command String
"bootstrap" (BootstrapOptions -> Command
BootstrapCmd forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Parser a -> InfoMod a -> ParserInfo a
info Parser BootstrapOptions
bootstrapParser (forall a. String -> InfoMod a
progDesc String
"Bootstrap an existing Cabal project in the current directory"))
globalParser ::
Path Abs Dir ->
Parser GlobalOptions
globalParser :: Path Abs Dir -> Parser GlobalOptions
globalParser Path Abs Dir
realCwd = do
Maybe Bool
verbose <- forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional (Mod FlagFields Bool -> Parser Bool
switch (forall (f :: * -> *) a. HasName f => String -> Mod f a
long String
"verbose" forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. HasName f => Char -> Mod f a
short Char
'v' forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. String -> Mod f a
help String
"Verbose output"))
Path Abs Dir
cwd <- forall a. ReadM a -> Mod OptionFields a -> Parser a
option ReadM (Path Abs Dir)
absDirOption (forall (f :: * -> *) a. HasName f => String -> Mod f a
long String
"cwd" forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. String -> Mod f a
help String
"Force a different working directory" forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. HasValue f => a -> Mod f a
value Path Abs Dir
realCwd)
pure GlobalOptions {Maybe Bool
Path Abs Dir
cwd :: Path Abs Dir
verbose :: Maybe Bool
$sel:cwd:GlobalOptions :: Path Abs Dir
$sel:verbose:GlobalOptions :: Maybe Bool
..}
appParser ::
Path Abs Dir ->
Parser Options
appParser :: Path Abs Dir -> Parser Options
appParser Path Abs Dir
cwd =
GlobalOptions -> Command -> Options
Options forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Path Abs Dir -> Parser GlobalOptions
globalParser Path Abs Dir
cwd forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> forall a. Mod CommandFields a -> Parser a
hsubparser Mod CommandFields Command
commands
parseCli ::
IO Options
parseCli :: IO Options
parseCli = do
Path Abs Dir
realCwd <- forall (m :: * -> *). MonadIO m => m (Path Abs Dir)
getCurrentDir
forall a. ParserPrefs -> ParserInfo a -> IO a
customExecParser ParserPrefs
parserPrefs (forall a. Parser a -> InfoMod a -> ParserInfo a
info (Path Abs Dir -> Parser Options
appParser Path Abs Dir
realCwd forall (f :: * -> *) a b. Applicative f => f a -> f (a -> b) -> f b
<**> forall a. Parser (a -> a)
helper) forall {a}. InfoMod a
desc)
where
parserPrefs :: ParserPrefs
parserPrefs =
PrefsMod -> ParserPrefs
prefs (PrefsMod
showHelpOnEmpty forall a. Semigroup a => a -> a -> a
<> PrefsMod
showHelpOnError)
desc :: InfoMod a
desc =
forall {a}. InfoMod a
fullDesc forall a. Semigroup a => a -> a -> a
<> forall a. String -> InfoMod a
header String
"Tools for maintaining Hix projects"