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

Safe HaskellSafe
LanguageHaskell2010

Multiarg.Util

Description

Grab bag of miscellaneous functions.

Synopsis

Documentation

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

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)]) #

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

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

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.