| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Options.Applicative.Builder.Extra
Description
Extra functions for optparse-applicative.
- boolFlags :: Bool -> String -> String -> Mod FlagFields Bool -> Parser Bool
- boolFlagsNoDefault :: Maybe Bool -> String -> String -> Mod FlagFields Bool -> Parser Bool
- maybeBoolFlags :: String -> String -> Mod FlagFields (Maybe Bool) -> Parser (Maybe Bool)
- enableDisableFlags :: Eq a => a -> a -> a -> String -> String -> Mod FlagFields a -> Parser a
- enableDisableFlagsNoDefault :: Eq a => a -> a -> Maybe a -> String -> String -> Mod FlagFields a -> Parser a
- extraHelpOption :: String -> String -> String -> Parser (a -> a)
- execExtraHelp :: [String] -> String -> Parser a -> String -> IO ()
- textOption :: Mod OptionFields Text -> Parser Text
- textArgument :: Mod ArgumentFields Text -> Parser Text
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.
textOption :: Mod OptionFields Text -> Parser Text Source