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

Safe HaskellSafe-Infered

Options.Applicative.Extra

Contents

Synopsis

Extra parser utilities

This module contains high-level functions to run parsers.

helper :: Parser (a -> a)Source

A hidden "helper" option which always fails.

execParser :: ParserInfo a -> IO aSource

Run a program description.

Parse command line arguments. Display help text and exit if any parse error occurs.

execParserPureSource

Arguments

:: ParserPrefs

Global preferences for this parser

-> ParserInfo a

Description of the program to run

-> [String]

Program arguments

-> Either ParserFailure a 

A pure version execParser.

usage :: ParserPrefs -> Parser a -> String -> StringSource

Generate option summary.

data ParserFailure Source

Result after a parse error.

Constructors

ParserFailure 

Fields

errMessage :: String -> String

Function which takes the program name as input and returns an error message

errExitCode :: ExitCode

Exit code to use for this error

Instances