Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Common parsers for options
option
specifies a named value on the command lineflag
specifies a value derived from the presence of the flagnamed
specifies a value derived from the name of a flagswitch
specifies a flag with a boolean valueargument
specifies a value not delimited by an option name, the first string value is parsedpositional
specifies an argument which is expected to be at a specific place in the list of arguments
Synopsis
- option :: forall s a. (KnownSymbol s, Typeable a, Show a) => OptionDescriptionUpdates -> Registry _ _
- options :: forall s a. (KnownSymbol s, Typeable a, Show a) => OptionDescriptionUpdates -> Registry _ _
- optionMaybe :: forall s a. (KnownSymbol s, Typeable a, Show a) => OptionDescriptionUpdates -> Registry _ _
- flag :: forall s a. (KnownSymbol s, Typeable a, Show a) => a -> Maybe a -> OptionDescriptionUpdates -> Registry _ _
- named :: forall s a. (KnownSymbol s, Typeable a, Show a) => OptionDescriptionUpdates -> Registry _ _
- switch :: forall s. KnownSymbol s => OptionDescriptionUpdates -> Registry _ _
- argument :: forall s a. (KnownSymbol s, Typeable a, Show a) => OptionDescriptionUpdates -> Registry _ _
- arguments :: forall s a. (KnownSymbol s, Typeable a, Show a) => OptionDescriptionUpdates -> Registry _ _
- positional :: forall s a. (KnownSymbol s, Typeable a, Show a) => Int -> OptionDescriptionUpdates -> Registry _ _
- setActiveValue :: forall s a. (KnownSymbol s, Typeable a) => a -> Typed (ActiveValue s a)
- setDefaultValue :: forall s a. (KnownSymbol s, Typeable a) => a -> Typed (DefaultValue s a)
- setDefaultValues :: forall s a. (KnownSymbol s, Typeable a) => Maybe a -> Maybe a -> Registry _ _
- setNoDefaultValues :: forall s a. (KnownSymbol s, Typeable a) => Registry _ _
- commandNameParser :: Text -> Parser Command ()
Documentation
option :: forall s a. (KnownSymbol s, Typeable a, Show a) => OptionDescriptionUpdates -> Registry _ _ Source #
Create an option: - with a short/long name - a metavar - no active/default values
The OptionDescriptionUpdates list can be used to override values or provide a help
options :: forall s a. (KnownSymbol s, Typeable a, Show a) => OptionDescriptionUpdates -> Registry _ _ Source #
Create a parser for a list of values
optionMaybe :: forall s a. (KnownSymbol s, Typeable a, Show a) => OptionDescriptionUpdates -> Registry _ _ Source #
Create a parser for an optional value
flag :: forall s a. (KnownSymbol s, Typeable a, Show a) => a -> Maybe a -> OptionDescriptionUpdates -> Registry _ _ Source #
Create a flag: - with a short/long name - a metavar - an active value - an optional default value
The OptionDescriptionUpdates list can be used to override values or provide a help
named :: forall s a. (KnownSymbol s, Typeable a, Show a) => OptionDescriptionUpdates -> Registry _ _ Source #
Create a flag where the name of the flag can be decoded as a value: The OptionDescriptionUpdates list can be used to override values or provide a help
switch :: forall s. KnownSymbol s => OptionDescriptionUpdates -> Registry _ _ Source #
Create a switch: - with a short/long name - a metavar - an active value: True - an default value: False
The OptionDescriptionUpdates list can be used to override values or provide a help
argument :: forall s a. (KnownSymbol s, Typeable a, Show a) => OptionDescriptionUpdates -> Registry _ _ Source #
Create an argument: - with no short/long names - a metavar - no active/default values
The OptionDescriptionUpdates list can be used to override values or provide a help
When the argument is read, its value is removed from the list of lexed values
arguments :: forall s a. (KnownSymbol s, Typeable a, Show a) => OptionDescriptionUpdates -> Registry _ _ Source #
Create a parser for a list of arguments
positional :: forall s a. (KnownSymbol s, Typeable a, Show a) => Int -> OptionDescriptionUpdates -> Registry _ _ Source #
Create a positional argument, to parse the nth value (starting from 0): - with no short/long names - a metavar - no active/default values
The OptionDescriptionUpdates list can be used to override values or provide a help
When the argument is read, its value is left in the list of lexed values
setActiveValue :: forall s a. (KnownSymbol s, Typeable a) => a -> Typed (ActiveValue s a) Source #
Set an active value for a given field name and field type
setDefaultValue :: forall s a. (KnownSymbol s, Typeable a) => a -> Typed (DefaultValue s a) Source #
Set a default value for a given field name and field type
setDefaultValues :: forall s a. (KnownSymbol s, Typeable a) => Maybe a -> Maybe a -> Registry _ _ Source #
Allow to specify that a given field name and type has some default/active values
setNoDefaultValues :: forall s a. (KnownSymbol s, Typeable a) => Registry _ _ Source #
Allow to specify that a given field name and type has no default/active values