stack-2.15.1: The Haskell Tool Stack
Safe HaskellSafe-Inferred
LanguageGHC2021

Options.Applicative.Complicated

Description

Simple interface to complicated program arguments.

This is a "fork" of the optparse-simple package that has some workarounds for optparse-applicative issues that become problematic with programs that have many options and subcommands. Because it makes the interface more complex, these workarounds are not suitable for pushing upstream to optparse-applicative.

Synopsis

Documentation

addCommand Source #

Arguments

:: String

command string

-> String

title of command

-> String

footer of command help

-> (opts -> RIO Runner ())

constructor to wrap up command in common data type

-> (opts -> GlobalOptsMonoid -> GlobalOptsMonoid)

extend common settings from local settings

-> Parser GlobalOptsMonoid

common parser

-> Parser opts

command parser

-> AddCommand 

Add a command to the options dispatcher.

addSubCommands Source #

Arguments

:: String

command string

-> String

title of command

-> String

footer of command help

-> Parser GlobalOptsMonoid

common parser

-> AddCommand

sub-commands (use addCommand)

-> AddCommand 

Add a command that takes sub-commands to the options dispatcher.

complicatedOptions Source #

Arguments

:: Version

numeric version

-> Maybe String

version string

-> String

Hpack numeric version, as string

-> String

header

-> String

program description (displayed between usage and options listing in the help output)

-> String

footer

-> Parser GlobalOptsMonoid

common settings

-> Maybe (ParserFailure ParserHelp -> [String] -> IO (GlobalOptsMonoid, (RIO Runner (), GlobalOptsMonoid)))

optional handler for parser failure; handleParseResult is called by default

-> AddCommand

commands (use addCommand)

-> IO (GlobalOptsMonoid, RIO Runner ()) 

Generate and execute a complicated options parser.

complicatedParser Source #

Arguments

:: String

metavar for the sub-command

-> Parser GlobalOptsMonoid

common settings

-> AddCommand

commands (use addCommand)

-> Parser (GlobalOptsMonoid, (RIO Runner (), GlobalOptsMonoid)) 

Generate a complicated options parser.