Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
System.Console.Options.TH.Failure
Description
Failure
pretty-printing.
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
failure case.
>>>
oversaturated "foo"
option '--foo' doesn't allow an argument>>>
oversaturated ""
end of options delimiter '--' doesn't allow an argument