| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Shrun.Configuration.Args.Parsing.Utils
Synopsis
- mkHelp :: forall (f :: Type -> Type) a. String -> Mod f a
- mkHelpNoLine :: forall (f :: Type -> Type) a. String -> Mod f a
- withDisabledParser :: ReadM a -> [Mod OptionFields (WithDisabled a)] -> (Bool, [String]) -> Parser (WithDisabled a)
- mWithDisabledParser :: ReadM a -> [Mod OptionFields (WithDisabled a)] -> (Bool, [String]) -> Parser (Maybe (WithDisabled a))
- withDisabledParserNoOpts :: ReadM a -> [Mod OptionFields (WithDisabled a)] -> Parser (WithDisabled a)
- switchParser :: (Bool -> a) -> String -> String -> Parser (Maybe a)
- switchParserNoLine :: (Bool -> a) -> String -> String -> Parser (Maybe a)
- switchParserOpts :: Mod OptionFields Bool -> (Bool -> a) -> String -> String -> Parser (Maybe a)
- autoStripUnderscores :: Read a => ReadM a
- itemize :: NESeq String -> Mod OptionFields a
- itemizeNoLine :: NESeq String -> Mod OptionFields a
- itemizeHelper :: NESeq String -> Chunk DocOA
- toChunk :: a -> Chunk a
- toMDoc :: String -> Maybe DocOA
Simple help
Disabled parser
Arguments
| :: ReadM a | Reader for a. |
| -> [Mod OptionFields (WithDisabled a)] | Modifier list e.g. option name, help text. |
| -> (Bool, [String]) | Metavar string. |
| -> Parser (WithDisabled a) |
Constructs a parser for (WithDisabled a).
Arguments
| :: ReadM a | Reader for a. |
| -> [Mod OptionFields (WithDisabled a)] | Modifier list e.g. option name, help text. |
| -> (Bool, [String]) | Metavar string. |
| -> Parser (Maybe (WithDisabled a)) |
Constructs a parser for (Maybe (WithDisabled a)).
withDisabledParserNoOpts Source #
Arguments
| :: ReadM a | Reader for a. |
| -> [Mod OptionFields (WithDisabled a)] | Modifier list e.g. option name, help text. |
| -> Parser (WithDisabled a) |
Constructs a parser for (Maybe (WithDisabled a)).
Switch parser
switchParserOpts :: Mod OptionFields Bool -> (Bool -> a) -> String -> String -> Parser (Maybe a) Source #
Misc
autoStripUnderscores :: Read a => ReadM a Source #
Reads Text, strips underscores, then uses the Read class. This is
essentially auto but removes underscores. This is used for nicer
numeric values e.g. allowing parsing "1_000_000" as a Num.
itemize :: NESeq String -> Mod OptionFields a Source #
Make an itemized list e.g.
itemize [intro, l1, l2, l2]
==> intro
- l1
- l2
- l3
itemizeNoLine :: NESeq String -> Mod OptionFields a Source #
itemize that does not append a trailing newline. Useful for the last
option in a group, as groups already start a newline.