Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Support for storing help messages associated to options and for displaying a full help message
Synopsis
- data Help = Help {}
- type HelpUpdate = Help -> Help
- makeHelp :: [HelpUpdate] -> Help
- noHelp :: Help
- shortDescription :: Text -> HelpUpdate
- longDescription :: Text -> HelpUpdate
- commandHelp :: Text -> Text -> Text -> Help
- noCommandName :: Help -> Help
- defaultSubcommand :: Help -> Help
- alt :: Help -> Help -> Help
- fromCliOption :: OptionDescription -> Help
Documentation
This data type contains optional fields describing either a full command or just a single option A command refers to a list of command fields but can also contain subcommands
Help | |
|
type HelpUpdate = Help -> Help Source #
Function updating the help
makeHelp :: [HelpUpdate] -> Help Source #
Create a Help from a list of updates
shortDescription :: Text -> HelpUpdate Source #
Create a Help value with a short command description
longDescription :: Text -> HelpUpdate Source #
Create a Help value with a long command description
commandHelp :: Text -> Text -> Text -> Help Source #
Create a Help value with a command name, a long and a short description
noCommandName :: Help -> Help Source #
Create a Help value with no command name
defaultSubcommand :: Help -> Help Source #
Set the current subcommand as the default one
alt :: Help -> Help -> Help Source #
Create a Help description for the alternative of 2 different help descriptions
This function is used for collecting the helps of 2 parsers when using the |
operator
- two commands end-up being the subcommands of the alternative
- a command alternated with some fields becomes a subcommand
fromCliOption :: OptionDescription -> Help Source #
Create a Help value from the description of a simple option