Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- execOptWithCtx :: forall c a. (TraversableB a, ProductB a, TraversableB c, ProductB c, GetSource c Identity, RunSource (SourceVal c) a) => HargCtx -> c Opt -> a Opt -> IO (a Identity)
- execOpt :: forall c a. (TraversableB a, ProductB a, TraversableB c, ProductB c, GetSource c Identity, RunSource (SourceVal c) a) => c Opt -> a Opt -> IO (a Identity)
- execOptWithCtxDef :: forall a. (TraversableB a, ProductB a) => HargCtx -> a Opt -> IO (a Identity)
- execOptDef :: forall a. (TraversableB a, ProductB a) => a Opt -> IO (a Identity)
- execCommandsWithCtx :: forall c ts xs. (TraversableB (VariantF xs), TraversableB c, ProductB c, Subcommands ts xs, GetSource c Identity, All (RunSource (SourceVal (c :* HiddenSources))) xs, All (RunSource ()) xs, MapAssocList xs) => HargCtx -> c Opt -> AssocListF ts xs Opt -> IO (VariantF xs Identity)
- execCommands :: forall c ts xs. (TraversableB (VariantF xs), TraversableB c, ProductB c, Subcommands ts xs, GetSource c Identity, All (RunSource (SourceVal (c :* HiddenSources))) xs, All (RunSource ()) xs, MapAssocList xs) => c Opt -> AssocListF ts xs Opt -> IO (VariantF xs Identity)
- execCommandsWithCtxDef :: forall ts xs. (TraversableB (VariantF xs), Subcommands ts xs, All (RunSource (SourceVal (DefaultSources :* HiddenSources))) xs, All (RunSource ()) xs, MapAssocList xs) => HargCtx -> AssocListF ts xs Opt -> IO (VariantF xs Identity)
- execCommandsDef :: forall ts xs. (TraversableB (VariantF xs), Subcommands ts xs, All (RunSource (SourceVal (DefaultSources :* HiddenSources))) xs, All (RunSource ()) xs, MapAssocList xs) => AssocListF ts xs Opt -> IO (VariantF xs Identity)
- execParser :: HargCtx -> Parser a -> IO a
- failParser :: Parser a -> [SourceRunError] -> IO a
- execParserPure :: [String] -> Parser a -> ParserResult a
Documentation
:: (TraversableB a, ProductB a, TraversableB c, ProductB c, GetSource c Identity, RunSource (SourceVal c) a) | |
=> HargCtx | Context containing the environment and the cmdline args |
-> c Opt | Source options |
-> a Opt | Target configuration options |
-> IO (a Identity) |
Run the option parser and combine with values from the specified sources, passing the context explicitly.
:: (TraversableB a, ProductB a, TraversableB c, ProductB c, GetSource c Identity, RunSource (SourceVal c) a) | |
=> c Opt | Source options |
-> a Opt | Target configuration options |
-> IO (a Identity) |
Run the option parser and combine with values from the specified sources
:: (TraversableB a, ProductB a) | |
=> HargCtx | Context containing the environment and the cmdline args |
-> a Opt | Target configuration options |
-> IO (a Identity) |
Run the option parser only with default sources (environment variables), passing the context explicitly.
:: (TraversableB a, ProductB a) | |
=> a Opt | Target configuration options |
-> IO (a Identity) |
Run the option parser only with default sources (environment variables)
:: (TraversableB (VariantF xs), TraversableB c, ProductB c, Subcommands ts xs, GetSource c Identity, All (RunSource (SourceVal (c :* HiddenSources))) xs, All (RunSource ()) xs, MapAssocList xs) | |
=> HargCtx | Context containing the environment and the cmdline args |
-> c Opt | Source options |
-> AssocListF ts xs Opt | Target options associated with subcommands |
-> IO (VariantF xs Identity) |
Run the subcommand parser and combine with values from the specified sources, passing the context explicitly.
:: (TraversableB (VariantF xs), TraversableB c, ProductB c, Subcommands ts xs, GetSource c Identity, All (RunSource (SourceVal (c :* HiddenSources))) xs, All (RunSource ()) xs, MapAssocList xs) | |
=> c Opt | Source options |
-> AssocListF ts xs Opt | Target options associated with subcommands |
-> IO (VariantF xs Identity) |
Run the subcommand parser and combine with values from the specified sources
execCommandsWithCtxDef Source #
:: (TraversableB (VariantF xs), Subcommands ts xs, All (RunSource (SourceVal (DefaultSources :* HiddenSources))) xs, All (RunSource ()) xs, MapAssocList xs) | |
=> HargCtx | Context containing the environment and the cmdline args |
-> AssocListF ts xs Opt | Target options associated with subcommands |
-> IO (VariantF xs Identity) |
Run the subcommand parser only with default sources (environment variables), passing the context explicitly.
:: (TraversableB (VariantF xs), Subcommands ts xs, All (RunSource (SourceVal (DefaultSources :* HiddenSources))) xs, All (RunSource ()) xs, MapAssocList xs) | |
=> AssocListF ts xs Opt | Target options associated with subcommands |
-> IO (VariantF xs Identity) |
Run the subcommand parser only with default sources (environment variables)
execParser :: HargCtx -> Parser a -> IO a Source #
Run the optparse-applicative parser, printing accumulated errors. Errors are printed as warnings if the parser succeeds.
failParser :: Parser a -> [SourceRunError] -> IO a Source #
execParserPure :: [String] -> Parser a -> ParserResult a Source #
Run the optparse-applicative parser and return the
ParserResult