Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- runSettingsParser :: HasParser a => Version -> String -> IO a
- runParser :: Version -> String -> Parser a -> IO a
- runParserOn :: Maybe TerminalCapabilities -> Parser a -> Args -> EnvMap -> Maybe Object -> IO (Either (NonEmpty ParseError) a)
- runHelpParser :: Maybe TerminalCapabilities -> Args -> Parser a -> IO (Either (NonEmpty ParseError) (Maybe ([String], CommandDoc (Maybe SetDoc))))
- internalParser :: Parser a -> Parser (Internal a)
Documentation
:: HasParser a | |
=> Version | Program version, get this from Paths_your_package_name |
-> String | Program description |
-> IO a |
Run runParser
on your Settings
' type's settingsParser
.
This is most likely the function you want to be using.
:: Version | Program version, get this from Paths_your_package_name |
-> String | Program description |
-> Parser a | |
-> IO a |
Run a parser
This function with exit on:
- Parse failure: show a nice error message.
-h|--help
: Show help text--version
: Show version information--render-man-page
: Render a man page--bash-completion-script
: Render a bash completion script--zsh-completion-script
: Render a zsh completion script--fish-completion-script
: Render a fish completion scriptquery-opt-env-conf-completion
: Perform a completion query
This gets the arguments and environment variables from the current process.
runParserOn :: Maybe TerminalCapabilities -> Parser a -> Args -> EnvMap -> Maybe Object -> IO (Either (NonEmpty ParseError) a) Source #
Run a parser on given arguments and environment instead of getting them from the current process.
runHelpParser :: Maybe TerminalCapabilities -> Args -> Parser a -> IO (Either (NonEmpty ParseError) (Maybe ([String], CommandDoc (Maybe SetDoc)))) Source #
internalParser :: Parser a -> Parser (Internal a) Source #