claw-prettyprinter-0.1.0.0: claw + prettyprinter
Safe HaskellSafe-Inferred
LanguageHaskell2010

System.Console.Options.TH.Failure

Description

Failure pretty-printing.

Synopsis

Documentation

failure :: Options Identity f -> Failure -> Doc ann Source #

Failure description, with suggestions if applicable.

Examples for each specific failure case are given below.

Constituents

unrecognized :: Options Identity f -> String -> Name -> Doc ann Source #

Unrecognized failure case, with suggestions if applicable.

>>> let names = Short 'i' :| [Short 'a', Short 'b', Long "abode"]
>>> let opts = $$(precompile $ none .> Option names (plain [|| id ||]))
>>> putDocW 80 $ failure opts $ Unrecognized "abid" (Long "abid")
invalid option '--abid'; perhaps you meant any of '-a', '-b', '-i' or '--abode'?

unsaturated :: Name -> Doc ann Source #

Unsaturated failure case.

>>> unsaturated (Long 'foo')
option '--foo' requires an argument

oversaturated Source #

Arguments

:: Text

Long option name, may be empty (consider --=ARG).

-> Doc ann 

Oversaturated failure case.

>>> oversaturated "foo"
option '--foo' doesn't allow an argument
>>> oversaturated ""
end of options delimiter '--' doesn't allow an argument