claw-prettyprinter
Safe HaskellNone
LanguageHaskell2010

System.Console.Options.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 Source #

Arguments

:: Options Identity f 
-> ShortByteString

Argument converted to WTF-8.

-> Name 
-> Doc ann 

Unrecognized failure case, with suggestions if applicable.

>>> let opt = Option [Short 'i', Short 'a', Short 'b', Long "abode"] Plain
>>> let opts = insert opt id none
>>> unrecognized opts "--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

:: ShortText

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