stack-0.1.5.0: The Haskell Tool Stack

Safe HaskellSafe
LanguageHaskell2010

Options.Applicative.Builder.Extra

Description

Extra functions for optparse-applicative.

Synopsis

Documentation

boolFlags :: Bool -> String -> String -> Mod FlagFields Bool -> Parser Bool Source

Enable/disable flags for a Bool.

boolFlagsNoDefault :: Maybe Bool -> String -> String -> Mod FlagFields Bool -> Parser Bool Source

Enable/disable flags for a Bool, without a default case (to allow chaining |s).

maybeBoolFlags :: String -> String -> Mod FlagFields (Maybe Bool) -> Parser (Maybe Bool) Source

Enable/disable flags for a (Maybe Bool).

enableDisableFlags :: Eq a => a -> a -> a -> String -> String -> Mod FlagFields a -> Parser a Source

Enable/disable flags for any type.

enableDisableFlagsNoDefault :: Eq a => a -> a -> Maybe a -> String -> String -> Mod FlagFields a -> Parser a Source

Enable/disable flags for any type, without a default (to allow chaining |s)

extraHelpOption :: String -> String -> String -> Parser (a -> a) Source

Show an extra help option (e.g. --docker-help shows help for all --docker* args). To actually show have that help appear, use execExtraHelp before executing the main parser.

execExtraHelp :: [String] -> String -> Parser a -> String -> IO () Source

Display extra help if extea help option passed in arguments. Since optparse-applicative doesn't allow an arbirary IO action for an abortOption, this was the best way I found that doesn't require manually formatting the help.