bishbosh-0.1.4.0: Plays chess.
Safe HaskellSafe-Inferred
LanguageHaskell2010

BishBosh.Input.CommandLineOption

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
To facilitate processing of command-line options.
Synopsis

Types

Type-synonyms

type Flag = String Source #

Synonym.

Data-types

data CommandLineOption options Source #

The sum-type of categories of command-line option.

Constants

longFlagPrefix :: Flag Source #

The prefix used to denote the long form of a command-line flag.

Functions

categorise :: [CommandLineOption options] -> CategorisedCommandLineOptions options Source #

  • Partition a list of CommandLineOptions according to their data-constructor.
  • N.B.: preserves the order of all specifications sharing a data-constructor.

getArgs Source #

Arguments

:: [Flag]

The list acceptible abbreviations for the required flag, each preceded by "--".

-> [String]

The command-line arguments to search.

-> [String]

The matching argument-values.

  • Return the list of arguments extracted from the specified command-line, which match the specified flag.
  • CAVEAT: All unique abbreviations must also be supplied. Doesn't cope with short flags preceded by -.

readArg :: Read a => String -> a Source #

Parse the specified string, returning the specified explanatory error-message on failure.

readBoundedIntegral :: Integral i => String -> i Source #

Reads a bounded integral value from the command-line, guarding against overflow.

Constructors

mkIOAction :: IOAction -> CommandLineOption options Source #

Constructor.

mkOptionsMutator :: OptionsMutator options -> CommandLineOption options Source #

Constructor.