Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- To facilitate processing of command-line options.
Synopsis
- type Flag = String
- data CommandLineOption options
- longFlagPrefix :: Flag
- categorise :: [CommandLineOption options] -> CategorisedCommandLineOptions options
- getArgs :: [Flag] -> [String] -> [String]
- readArg :: Read a => String -> a
- readBoundedIntegral :: Integral i => String -> i
- mkConfigLocationParameter :: FilePath -> CommandLineOption options
- mkIOAction :: IOAction -> CommandLineOption options
- mkContextualIOAction :: ContextualIOAction options -> CommandLineOption options
- mkOptionsMutator :: OptionsMutator options -> CommandLineOption options
Types
Type-synonyms
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.
:: [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
mkConfigLocationParameter :: FilePath -> CommandLineOption options Source #
Constructor.
mkIOAction :: IOAction -> CommandLineOption options Source #
Constructor.
mkContextualIOAction :: ContextualIOAction options -> CommandLineOption options Source #
Constructor.
mkOptionsMutator :: OptionsMutator options -> CommandLineOption options Source #
Constructor.