| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Options.UU.Interleaved
- required :: Entry a a
- option :: Entry a a
- options :: Entry [a] a
- optionsl :: (ShowParserType a, MonadState [a] m) => (m () -> StateT [b1] Identity b) -> ([Char], P (Str Char String Int) a, [Char]) -> (Gram (P (Str Char String Int)) (b2 -> b1), [Char])
- optionsf :: (ShowParserType a, MonadState [a] m) => (m () -> StateT [c] Identity b) -> ([Char], P (Str Char String Int) a, [Char]) -> (Gram (P (Str Char String Int)) ([c] -> c), [Char])
- flag :: EntryVal a a
- flags :: EntryVals a a
- field :: (Functor f, MonadState a m) => (m () -> StateT r Identity b) -> (f (a -> a), t) -> (f (r -> r), t)
- choose :: EntryVals a a
- change :: EntryVals a a
- class ShowParserType a where
- pString :: (IsLocationUpdatedBy loc Char, ListLike state Char) => P (Str Char state loc) [Char]
- pBool :: (IsLocationUpdatedBy loc Char, ListLike state Char) => P (Str Char state loc) Bool
- run :: a -> (Gram (P (Str Char String Int)) (a -> a), String) -> String -> Either (OptionResult a) [Char]
- data OptionResult a
Documentation
an option entry specied an entry which may be provided; if absent the default value is taken
An options entry specifies an element which may occur more than once. The final value contains the list of all the values encountered.
optionsl :: (ShowParserType a, MonadState [a] m) => (m () -> StateT [b1] Identity b) -> ([Char], P (Str Char String Int) a, [Char]) -> (Gram (P (Str Char String Int)) (b2 -> b1), [Char]) Source
An optionl entry specifies an element which may occur more than once. The last one encountered is taken
optionsl :: Entry a a
optionsf :: (ShowParserType a, MonadState [a] m) => (m () -> StateT [c] Identity b) -> ([Char], P (Str Char String Int) a, [Char]) -> (Gram (P (Str Char String Int)) ([c] -> c), [Char]) Source
An optionf entry specifies an element which may occur more than once. The first one encountered is taken
optionsf :: Entry a a
A flags entry introduces a list of possible parameters, each with a value to which the field should be set
field :: (Functor f, MonadState a m) => (m () -> StateT r Identity b) -> (f (a -> a), t) -> (f (r -> r), t) Source
A field entry introduces a collection of options which are used to set fields in a sub-record of the main record
choose :: EntryVals a a Source
A choose entry introduces a list of choices for the specific entry; precisely one should be given
class ShowParserType a where Source
Instances
pString :: (IsLocationUpdatedBy loc Char, ListLike state Char) => P (Str Char state loc) [Char] Source
Arguments
| :: a | the record containing the default values |
| -> (Gram (P (Str Char String Int)) (a -> a), String) | the specification of the various options |
| -> String | The string containing the given options, separated by EOT |
| -> Either (OptionResult a) [Char] | The result is either an updated record ( |
The function run equips the given option specification with an option to ask for --help. It concatenates the files coming from the command line and terminates them with an EOT.
Make sure your command line arguments do not contain an EOT. It parses the command line arguments and updates the `default` record passed to it
data OptionResult a Source