Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module deals with loading configurations.
Synopsis
- data Options opts
- = ShowHelp
- | ShowVersion
- | Options opts [FilePath]
- data ColorOptions = ColorOptions {
- noColorsErr :: Bool
- noColorsOut :: Bool
- defaultColorOptions :: ColorOptions
- allColors :: ColorOptions
- noColors :: ColorOptions
- data EarlyConfig opts = EarlyConfig {
- showHelp :: Bool
- showVersion :: Bool
- configFile :: Maybe FilePath
- colorOptions :: ColorOptions
- options :: OptSetter opts
- files :: [FilePath]
- commandLineOptions :: Config opts -> OptSpec (EarlyConfig opts)
- delayOpt :: OptSetter opts -> OptSetter (EarlyConfig opts)
- data ConfigFileLoc
- data ConfigError
- ppConfigError :: ConfigError -> String
- loadConfig :: Text -> Config opts -> IO (ColorOptions, Options opts)
- fromFile :: Text -> Config opts -> Maybe FilePath -> IO opts
- fromEnv :: opts -> EnvDescr opts -> IO opts
Documentation
The result of loading a configuration.
ShowHelp | Show help and exit |
ShowVersion | Show version and exit |
Options opts [FilePath] | We loaded some options |
data ColorOptions Source #
Instances
Generic ColorOptions Source # | |
Defined in Crux.Config.Load type Rep ColorOptions :: Type -> Type # from :: ColorOptions -> Rep ColorOptions x # to :: Rep ColorOptions x -> ColorOptions # | |
type Rep ColorOptions Source # | |
Defined in Crux.Config.Load type Rep ColorOptions = D1 ('MetaData "ColorOptions" "Crux.Config.Load" "crux-0.7-DD4jascIe8aJ5p2f7vnjLq" 'False) (C1 ('MetaCons "ColorOptions" 'PrefixI 'True) (S1 ('MetaSel ('Just "noColorsErr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "noColorsOut") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))) |
data EarlyConfig opts Source #
Command line options processed before loading the configuration file.
EarlyConfig | |
|
Instances
commandLineOptions :: Config opts -> OptSpec (EarlyConfig opts) Source #
data ConfigFileLoc Source #
Instances
Show ConfigFileLoc Source # | |
Defined in Crux.Config.Load showsPrec :: Int -> ConfigFileLoc -> ShowS # show :: ConfigFileLoc -> String # showList :: [ConfigFileLoc] -> ShowS # | |
ErrorAnnotation ConfigFileLoc Source # | |
Defined in Crux.Config.Load displayAnnotation :: ConfigFileLoc -> Doc # |
data ConfigError Source #
FailedToReadFile IOError | |
FailedToParseFile ParseError | |
FailedToProcessFile (ValueSpecMismatch ConfigFileLoc) | |
InvalidEnvVar String String String | variable, value, error message |
InvalidCommandLine [String] |
Instances
Exception ConfigError Source # | |
Defined in Crux.Config.Load | |
Show ConfigError Source # | |
Defined in Crux.Config.Load showsPrec :: Int -> ConfigError -> ShowS # show :: ConfigError -> String # showList :: [ConfigError] -> ShowS # |
ppConfigError :: ConfigError -> String Source #
loadConfig :: Text -> Config opts -> IO (ColorOptions, Options opts) Source #
Merges command-line options, environment variable options, and
configuration file options (in that order) to get the overall
Options configuration for running Crux. Throws ConfigError
on
failure.