optparse-applicative-0.17.0.0: Utilities and combinators for parsing command line options
Safe Haskell Safe-Inferred
Language Haskell98

Options.Applicative.Types

Synopsis

Documentation

data ParserInfo a Source #

A full description for a runnable Parser for a program.

Constructors

ParserInfo

Fields

data ParserPrefs Source #

Global preferences for a top-level Parser .

Constructors

ParserPrefs

Fields

data Option a Source #

A single option of a parser.

Constructors

Option

Fields

data OptReader a Source #

An OptReader defines whether an option matches an command line argument.

Constructors

OptReader [ OptName ] ( CReader a) ( String -> ParseError )

option reader

FlagReader [ OptName ] !a

flag reader

ArgReader ( CReader a)

argument reader

CmdReader ( Maybe String ) [ String ] ( String -> Maybe ( ParserInfo a))

command reader

data OptProperties Source #

Specification for an individual parser option.

Constructors

OptProperties

Fields

readerAsk :: ReadM String Source #

Return the value being read.

readerAbort :: ParseError -> ReadM a Source #

Abort option reader by exiting with a ParseError .

readerError :: String -> ReadM a Source #

Abort option reader by exiting with an error message.

data ArgPolicy Source #

Policy for how to handle options within the parse

Constructors

Intersperse

The default policy, options and arguments can be interspersed. A `--` option can be passed to ensure all following commands are treated as arguments.

NoIntersperse

Options must all come before arguments, once a single positional argument or subcommand is parsed, all remaining arguments are treated as positionals. A `--` option can be passed if the first positional one needs starts with - .

AllPositionals

No options are parsed at all, all arguments are treated as positionals. Is the policy used after `--` is encountered.

ForwardOptions

Options and arguments can be interspersed, but if a given option is not found, it is treated as a positional argument. This is sometimes useful if one is passing through most options to another tool, but are supplying just a few of their own options.

data SomeParser Source #

Constructors

forall a. SomeParser ( Parser a)

data Context Source #

Subparser context, containing the name of the subparser and its parser info. Used by parserFailure to display relevant usage information when parsing inside a subparser fails.

Constructors

forall a. Context String ( ParserInfo a)