Extension of the GetOpt
command line argument parser.
This module defines some utility functions to allow the parsing of option
arguments to also handle errors in the arguments.
Author: Björn Peemöller
Version: September 2015
onOpts
:: (a -> a) -> (a,[String]) -> (a,[String])
Lift a function on options to options and errors. |
onOptsArg
:: (String -> a -> a) -> String -> (a,[String]) -> (a,[String])
Lift a function on a string and options to options and errors. |
addErr
:: String -> (a,[String]) -> (a,[String])
Add an error message to a option/errors pair. |
option
:: String -> [String] -> [(String,String,a -> a)] -> String -> String -> OptDescr ((a,[String]) -> (a,[String]))
Convert an option table to option descriptions capable of error handling. |
parseOptErr
:: String -> [(String,String,a -> a)] -> String -> (a,[String]) -> (a,[String])
Parsing function for option specified as an option table. |
renderOptErrTable
:: [(String,String,a -> a)] -> String
Rendering of an option specified using an option table. |
Type synonym for option and error message
Type synonym: OptErr a = (a,[String])
An option table is a list of triples consisting of the option string, its description and the effect on the global option set.
Type synonym: OptTable a = [(String,String,a -> a)]
Lift a function on options to options and errors. |
Lift a function on a string and options to options and errors. |
Add an error message to a option/errors pair.
|
Convert an option table to option descriptions capable of error handling. |
Parsing function for option specified as an option table. |
Rendering of an option specified using an option table. |