| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Crux.Config.Load
Description
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.
Constructors
| ShowHelp | Show help and exit |
| ShowVersion | Show version and exit |
| Options opts [FilePath] | We loaded some options |
data ColorOptions Source #
Constructors
| ColorOptions | |
Fields
| |
Instances
| Generic ColorOptions Source # | |
Defined in Crux.Config.Load Associated Types type Rep ColorOptions :: Type -> Type # | |
| 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.
Constructors
| EarlyConfig | |
Fields
| |
Instances
commandLineOptions :: Config opts -> OptSpec (EarlyConfig opts) Source #
data ConfigFileLoc Source #
Constructors
| NoConfgFile | |
| AtPosition Position |
Instances
| Show ConfigFileLoc Source # | |
Defined in Crux.Config.Load Methods showsPrec :: Int -> ConfigFileLoc -> ShowS # show :: ConfigFileLoc -> String # showList :: [ConfigFileLoc] -> ShowS # | |
| ErrorAnnotation ConfigFileLoc Source # | |
Defined in Crux.Config.Load Methods displayAnnotation :: ConfigFileLoc -> Doc # | |
data ConfigError Source #
Constructors
| 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 Methods toException :: ConfigError -> SomeException # fromException :: SomeException -> Maybe ConfigError # displayException :: ConfigError -> String # | |
| Show ConfigError Source # | |
Defined in Crux.Config.Load Methods 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.