optparse-applicative-0.0.1: Utilities and combinators for parsing command line options

Safe HaskellNone

Options.Applicative.Types

Synopsis

Documentation

data ParserInfo a Source

A full description for a runnable Parser for a program.

Constructors

ParserInfo 

Fields

_infoParser :: Parser a

the option parser for the program

_infoFullDesc :: Bool

whether the help text should contain full documentation

_infoProgDesc :: String

brief parser description

_infoHeader :: String

header of the full parser description

_infoFooter :: String

footer of the full parser description

_infoFailureCode :: Int

exit code for a parser failure

Instances

infoParser :: forall a. Lens (ParserInfo a) (Parser a)Source

data Option r a Source

Specification for an individual parser option.

Constructors

Option

option continuation

Fields

_optMain :: OptReader r

reader for this option

_optDefault :: Maybe a

default value

_optShow :: Bool

whether this flag is shown is the brief description

_optHelp :: String

help text for this option

_optMetaVar :: String

metavariable for this option

_optCont :: r -> Maybe (Parser a)
 

Instances

data OptName Source

Constructors

OptShort !Char 
OptLong !String 

Instances

data OptReader a Source

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

Constructors

OptReader [OptName] (String -> Maybe a)

option reader

FlagReader [OptName] !a

flag reader

ArgReader (String -> Maybe a)

argument reader

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

command reader

Instances

data Parser a whereSource

A Parser a is an option parser returning a value of type a.

Constructors

NilP :: a -> Parser a 
ConsP :: Option r (a -> b) -> Parser a -> Parser b 

data P a Source

Constructors

ParseError 
ParseResult a 

Instances

optMain :: forall r a. Lens (Option r a) (OptReader r)Source

optDefault :: forall r a. Lens (Option r a) (Maybe a)Source

optShow :: forall r a. Lens (Option r a) BoolSource

optHelp :: forall r a. Lens (Option r a) StringSource

optMetaVar :: forall r a. Lens (Option r a) StringSource

optCont :: forall r a. Lens (Option r a) (r -> Maybe (Parser a))Source