Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Description for options A option has a long name (unless it's an argument), a short name, a metavar (its type), a help text
Synopsis
- data OptionDescription = OptionDescription {}
- type OptionDescriptionUpdate = OptionDescription -> OptionDescription
- type OptionDescriptionUpdates = [OptionDescriptionUpdate]
- makeOptionDescription :: OptionDescriptionUpdates -> OptionDescription
- name :: Text -> OptionDescriptionUpdate
- alias :: Text -> OptionDescriptionUpdate
- short :: Char -> OptionDescriptionUpdate
- noShort :: OptionDescriptionUpdate
- metavar :: Text -> OptionDescriptionUpdate
- help :: Text -> OptionDescriptionUpdate
- displayCliOptionName :: OptionDescription -> Text
- getNames :: OptionDescription -> [Text]
Documentation
data OptionDescription Source #
Optional values used to document a command line option
Instances
type OptionDescriptionUpdate = OptionDescription -> OptionDescription Source #
Function updating an OptionDescription
type OptionDescriptionUpdates = [OptionDescriptionUpdate] Source #
List of description updates
makeOptionDescription :: OptionDescriptionUpdates -> OptionDescription Source #
Apply a list of option description updates, from left to right, to the empty description
name :: Text -> OptionDescriptionUpdate Source #
Create an OptionDescriptionUpdate
with a long hyphenated name, for example name "collect-all"
alias :: Text -> OptionDescriptionUpdate Source #
Create an OptionDescriptionUpdate
with an alias for a given name
short :: Char -> OptionDescriptionUpdate Source #
Create an OptionDescriptionUpdate
with a short name, for example short 'q'
noShort :: OptionDescriptionUpdate Source #
Create an OptionDescriptionUpdate
with specifying that there must be no short name
metavar :: Text -> OptionDescriptionUpdate Source #
Create an OptionDescriptionUpdate
with a metavar to indicate the type of an option, for example metavar FILE
help :: Text -> OptionDescriptionUpdate Source #
Create an OptionDescriptionUpdate
with some help text, for example help "force the copy"
displayCliOptionName :: OptionDescription -> Text Source #
Display a OptionDescription
name
as a hyphenated name
return empty
if no name has been defined yet
getNames :: OptionDescription -> [Text] Source #
Return the possible names for an OptionDescription
if they are defined