multiarg-0.30.0.2: Command lines for options that take multiple arguments

Safe HaskellSafe-Inferred
LanguageHaskell2010

Multiarg.Util

Description

Grab bag of miscellaneous functions.

Synopsis

Documentation

mayLast :: [a] -> Maybe ([a], a) Source

Returns a list of the first items in a list and the last item, or Nothing if the list is empty.

splitOptSpecs :: [OptSpec a] -> ([(ShortName, ArgSpec a)], [(LongName, ArgSpec a)]) Source

Partitions a list of OptSpec into the short flags and long flags.

addHelpOption :: [OptSpec a] -> ([(ShortName, ArgSpec (Maybe a))], [(LongName, ArgSpec (Maybe a))]) Source

Adds an option for h and help. The resulting ArgSpec return Nothing if help was requested, or Just with the original argument for any other option.