shrun
Safe HaskellNone
LanguageGHC2021

Shrun.Configuration.Args.Parsing.Utils

Synopsis

Simple help

mkHelp :: forall (f :: Type -> Type) a. String -> Mod f a Source #

mkHelpNoLine :: forall (f :: Type -> Type) a. String -> Mod f a Source #

Disabled parser

withDisabledParser Source #

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).

mWithDisabledParser Source #

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

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.

toChunk :: a -> Chunk a Source #