d^[      Safe  !"#$  !"#$ !"#$Safe%&'%&%&'Safe - ()*+,-./0()*+,-./()*+,-./0Safe -345UType to wrap results from ./The CLI was used correctly and a value of type a! was successfully constructed."The CLI was used incorrectly. The  contains error messages.ZIt can also happen that the data type you're trying to use isn't supported. See the  9https://github.com/zalora/getopt-generics#getopt-genericsREADME for details.The CLI was used with --help. The  contains the help message.Handles an input of type  a:On  a it returns the value a.On  message it writes the message to 1 and throws 2.On  errs! it writes the error messages to 3 and throws 4 1.This is used by  to handle parse results. 56789:56756789: Safe !"*INU;<=>?@ABCDEFGHIJKLMNOP;<=>?@ABCDEFGHIJKLMNO ;<=>?@ABCDEFGHIJKLMNOP Safe !"4FU  3s can be used to customize the command line parser. AddShortOption fieldName c adds the Q c1 as a short option for the field addressed by  fieldName. !RenameOption fieldName customName- renames the option generated through the  fieldName by  customName. RenameOptions fO renames all options with the given functions. In case the function returns Nothing! the original field name is used.Can be used together with  . 0UseForPositionalArguments fieldName argumentType! fills the field addressed by  fieldNamer with the positional arguments (i.e. arguments that don't correspond to a flag). The field has to have type [R]. argumentTypeG is used as the type of the positional arguments in the help output. AddOptionHelp fieldName helpText$ adds a help text for the option  fieldName.AddVersionFlag version adds a  --version flag. STUVWXYZ"#$ STVW  STUVWXYZ None !")135NU is a typeclass for things that can be parsed as atomic values from single command line arguments, e.g. strings (and filenames) and numbers.Occasionally you might want to declare your own instance for additional type safety and for providing a more informative command argument type. Here's an example: q {-# LANGUAGE DeriveDataTypeable #-} import WithCli data File = File FilePath deriving (Show, Typeable) instance Argument File where argumentType Proxy = "custom-file-type" parseArgument f = Just (File f) instance HasArguments File where argumentsParser = atomicArgumentsParser main :: IO () main = withCli run run :: File -> IO () run = print*And this is how the above program behaves: ~ $ program --help program [OPTIONS] custom-file-type -h --help show help and exit $ program some/file File "some/file" [\]^_`[[\]^_`None !"&)+-013457>FIKLNU3Everything that can be used as an argument to your main function (see withCli) needs to have a  instance.{ also allows to conjure up instances for record types to create more complex command line interfaces. Here's an example: 1 {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} import WithCli data Options = Options { port :: Int, daemonize :: Bool, config :: Maybe FilePath } deriving (Show, Generic, HasArguments) main :: IO () main = withCli run run :: Options -> IO () run = print*In a shell this program behaves like this:  $ program --port 8080 --config some/path Options {port = 8080, daemonize = False, config = Just "some/path"} $ program --port 8080 --daemonize Options {port = 8080, daemonize = True, config = Nothing} $ program --port foo cannot parse as INTEGER: foo # exit-code 1 $ program missing option: --port=INTEGER # exit-code 1 $ program --help program [OPTIONS] --port=INTEGER --daemonize --config=STRING (optional) -h --help show help and exit.Useful for implementing your own instances of  on top of a custom  instance.abcdefghijklmnopqrstabcdefghijkabcdefghijklmnopqrstNone)357uvwuuvwNonePure variant of .The functionc parameter can be a function with arbitrary many parameters as long as they have an instance for $. You can choose the return type of function freely,  will return it wrapped in ) to account for parse errors, etc. (see ).  None 135>LNU!Everything that can be used as a main function with ! needs to have an instance of 8. You shouldn't need to implement your own instances.h converts an IO operation into a program with a proper CLI. Retrieves command line arguments through x. mainm (the given IO operation) can have arbitrarily many parameters provided all parameters have instances for .#May throw the following exceptions: ExitFailure 1@ in case of invalid options. Error messages are written to stderr. ExitSuccess in case --help is given. ( ExitSuccesso behaves like a normal exception, except that -- if uncaught -- the process will exit with exit-code 0.) Help output is written to stdout.Example: x import WithCli main :: IO () main = withCli run run :: String -> Int -> Bool -> IO () run s i b = print (s, i, b)#Using the above program in a shell: ~ $ program foo 42 true ("foo",42,True) $ program --help program [OPTIONS] STRING INTEGER BOOL -h --help show help and exit $ program foo 42 bar cannot parse as BOOL: bar # exit-code 1 $ program missing argument of type STRING missing argument of type INTEGER missing argument of type BOOL # exit-code 1 $ program foo 42 yes bar unknown argument: bar # exit-code 1This is a variant of U that allows to tweak the generated command line interface by providing a list of  s.yz{  yz{|     ! " # $ % &'()*++,-./0123456789:;<=>?@ABC@DBEFGHIJK L M N N O P Q R S S T U V W X Y Z [ \ ] ^ _`abcd e f g h i j k l m n o p q rstuvwxyz{|}~getop_KshoLRmJ9HaDFiqmZ0ImQh WithCli.PureWithCliWithCli.Modifier.TypesWithCli.Normalize WithCli.FlagWithCli.Result withCliPurewithCliWithCli.ParserWithCli.Modifier Data.List stripPrefixWithCli.ArgumentWithCli.HasArgumentsWithCli.Pure.InternalwithCliModifiedbaseData.Typeable.InternalTypeable GHC.GenericsGeneric Data.ProxyProxyResultSuccessErrors OutputAndExit handleResultModifierAddShortOption RenameOption RenameOptionsUseForPositionalArguments AddOptionHelpAddVersionFlagArgument argumentType parseArgument HasArgumentsargumentsParseratomicArgumentsParser WithCliPure Modifiers shortOptionsrenamingpositionalArgumentsField _helpTextsversion getVersionisPositionalArgumentsFieldgetPositionalArgumentTypematches normalize isAllowedCharFlagHelpVersionNoHelp foldFlags helpOption versionOptionusage $fMonoidFlagGHC.IO.Handle.FDstdoutGHC.IO.Exception ExitSuccessstderr ExitFailure|>sanitizesanitizeMessagestripTrailingSpaces $fMonadResult$fApplicativeResult Normalized UnnormalizedParser parserDefault parserOptionsparserNonOptions parserConvertNonOptionsParsernonOptionsTypenonOptionsOptionalnonOptionsParsercombineNonOptionsParser emptyParsernormalizeParsermodParserOptionscombine fillInOptionsfillInNonOptions runParser$fFunctorParserghc-prim GHC.TypesCharGHC.BaseString mkModifiers insertWithinsertapplyModifiersapplyModifiersLonglongsaddShortmodLongs readFloat$fArgumentDouble$fArgumentFloat$fArgumentInteger $fArgumentInt $fArgument[]parseArgumentResult parseErrorwrapForPositionalArguments listParserpositionalArgumentsParser maybeParser boolParser parseBool genericParser fieldsParsernoSelectorsParser$fHasArguments[]$fHasArgumentsMaybe$fHasArguments(,,)$fHasArguments(,)$fHasArgumentsDouble$fHasArgumentsFloat$fHasArguments[]0$fHasArgumentsBool$fHasArgumentsIntrun$fWithCliPure(->)output$fWithCliPureoutputoutputSystem.EnvironmentwithArgs $fWithCli(->) $fWithCliIO