gtU       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  NoneEThe general type of annotations that can be associated with a value.  NoneFlag: "DI want users to be able to omit the value associated with this flag." &Make the value of a flag optional. If --flag is given, it will  be treated as --flag= this_argument.   {hello = def &= opt "foo"} ' -h --hello[=VALUE] (default=foo) ZNote that all flags in CmdArgs are optional, and if omitted will use their default value.  Those annotated with opt@ also allow the flag to be present without an associated value.  As an example:  ' {hello = "DEFAULT" &= opt "OPTIONAL"}  $ main  {hello = "DEFAULT"}  $ main --hello  {hello = "OPTIONAL"}  $ main --hello=VALUE  {hello = "VALUE"} Flag: "7For this flag, users need to give something of type ..." The the type of a flag''s value, usually upper case. Only used 3 for the help message. Commonly the type will be FILE ()  or DIR ().  {hello = def &= typ "MESSAGE"}  -h --hello=MESSAGE Flag: "$Users must give a file for this flag's value."  Alias for  FILE. Flag: ")Users must give a directory for this flag's value."  Alias for  DIR. Flag/Mode: "The help message is ..." *Descriptive text used in the help output. & {hello = def &= help "Help message"} & -h --hello=VALUE Help message Flag: ""Use this flag name for this field." %Add flags which trigger this option.  {hello = def &= name "foo"}  -h --hello --foo=VALUE Flag: "Put non-flag arguments here."  {hello = def &= args} Flag: "#Put the nth non-flag argument here." BThis field should be used to store a particular argument position  (0-based).  {hello = def &= argPos 0} Flag/Mode: "Give these flags/&modes a group name in the help output." .This mode will be used for all following modes/flags, until the  next  groupname. ' {hello = def &= groupname "Welcomes"}  Welcomes  -h --hello=VALUE Mode: "(A longer description of this mode is ..." (Suffix to be added to the help message. G Sample{..} &= details ["More details on the website www.example.org"] Modes: "My program name/version/copyright is ..." :One line summary of the entire program, the first line of  --help and the only line of  --version. > Sample{..} &= summary "CmdArgs v0.0, (C) Neil Mitchell 1981" Mode: "If the user doesn't give a mode, use this one." FThis mode is the default. If no mode is specified and a mode has this G attribute then that mode is selected, otherwise an error is raised. 1 modes [Mode1{..}, Mode2{..} &= auto, Mode3{..}] Modes: ""My program executable is named ..." KThis is the name of the program executable. Only used in the help message. % Defaults to the type of the mode.  Sample{..} &= program "sample" Flag: "Don'!t guess any names for this field." 7A field should not have any flag names guessed for it. ' All flag names must be specified by flag. ) {hello = def &= explicit &= name "foo"}  --foo=VALUE Flag/Mode: "Ignore this field, don't let the user set it." .A mode or field is not dealt with by CmdArgs. & {hello = def, extra = def &= ignore}  --hello=VALUE Modes: "!My program needs verbosity flags." Add  --verbose and --quiet flags. Modes: "Customise the help argument." .Add extra options to a help argument, such as , ,  or . , Sample{..} &= helpArg [explicit, name "h"] Modes: "Customise the version argument." 1Add extra options to a version argument, such as , , ,   or . # Sample{..} &= versionArg [ignore] Modes: ""Customise the verbosity arguments." ,Add extra options to a verbosity arguments ( --verbose and --quiet),  such as , ,  or . The verbose options come ) first, followed by the quiet options. @ Sample{..} &= verbosityArgs [ignore] [name "silent", explicit]    None The verbosity data type HOutput lots of messages (typically errors, warnings and status updates) 7Output normal messages (typically errors and warnings) 2Only output essential messages (typically errors) Set the global verbosity. $Get the global verbosity. Initially Normal before any calls to . 7Used to test if warnings should be output to the user.  True if the verbosity is set to  or  (when --quiet is not specified). =Used to test if status updates should be output to the user.  True if the verbosity is set to  (when  --verbose is specified). DAn action to perform if the verbosity is normal or higher, based on . 8An action to perform if the verbosity is loud, based on .    None 5A structure to store the additional data relating to --help,   --version, --quiet and  --verbose. "$The underlying value being wrapped. #Just if --helpR is given, then gives the help message for display, including a trailing newline. $Just if  --versionU is given, then gives the version message for display, including a trailing newline. %Just if --quiet or  --verbose, is given, then gives the verbosity to use. &3Private: Only exported due to Haddock limitations.  !"#$%& !"#$%& !"#$%& None'TGiven a sequence of arguments, join them together in a manner that could be used on 6 the command line, giving preference to the Windows cmd shell quoting conventions. SFor an alternative version, intended for actual running the result in a shell, see !System.Process.showCommandForUser (CGiven a string, split into the available arguments. The inverse of '. '('('(None)Expand @: directives in a list of arguments, usually obtained from getArgs. ! As an example, given the file test.txt with the lines hello and world:  9 expandArgsAt ["@test.txt","!"] == ["hello","world","!"] Any @H directives in the files will be recursively expanded (raising an error $ if there is infinite recursion). )))None0,0An unnamed argument. Anything not starting with - is considered an argument,  apart from "-"( which is considered to be the argument "-", and any arguments  following "--". For example:  9 programname arg1 -j - --foo arg3 -- -arg4 --arg5=1 arg6 Would have the arguments: / ["arg1","-","arg3","-arg4","--arg5=1","arg6"] ."A way of processing the argument. /,The type of data for the argument, i.e. FILE/DIR/EXT 0XIs at least one of these arguments required, the command line will fail if none are set 1BA flag, consisting of a list of flag names and other information. 3The names for the flag. 4Information about a flag' s arguments. 5The way of processing a flag. 61The type of data for the flag argument, i.e. FILE/DIR/EXT 7,The help message associated with this flag. 8NA function to take a string, and a value, and either produce an error message  (Left), or a modified value (Right). 9The 9! type has the following meaning: < FlagReq FlagOpt FlagOptRare/FlagNone / -xfoo -x=foo -x=foo -x -foo . -x foo -x=foo -x foo -x foo . -x=foo -x=foo -x=foo -x=foo 0 --xx foo --xx=foo --xx foo --xx foo 0 --xx=foo --xx=foo --xx=foo --xx=foo : No argument ;6Optional argument that requires an = before the value <Optional argument =Required argument >+A mode. Each mode has three main features:  A list of submodes (@)  A list of flags (H) ! Optionally an unnamed argument (G) @The available sub-modes A[The names assigned to this mode (for the root mode, this name is used as the program name) BValue to start with CJCheck the value reprsented by a mode is correct, after applying all flags D4Given a value, try to generate the input arguments. E Help text F,A longer help suffix displayed after a mode GaThe unnamed arguments, a series of arguments, followed optionally by one for all remaining slots HGroups of flags ILA group of items (modes or flags). The items are treated as a list, but the = group structure is used when displaying the help message. KNormal items. L;Items that are hidden (not displayed in the help message). MFItems that have been grouped, along with a description of each group. NThe type of a flag, i.e. --foo=TYPE. O7A help message that goes with either a flag or a mode. P#A name, either the name of a flag (--foo) or the name of a mode. Q:Parse a boolean, accepts as True: true yes on enabled 1. RConvert a group into a list. S3Convert a list into a group, placing all fields in K. TExtract the modes from a > UExtract the flags from a > V Extract the value from inside a < or ;, or raises an error. W"Check that a mode is well formed. Z%Create an empty mode specifying only B-. All other fields will usually be populated  using record updates. [[Create a mode with a name, an initial value, some help text, a way of processing arguments  and a list of flags. \cCreate a list of modes, with a program name, an initial value, some help text and the child modes. ]VCreate a flag taking no argument value, with a list of flag names, an update function  and some help text. ^_Create a flag taking an optional argument value, with an optional value, a list of flag names, D an update function, the type of the argument and some help text. _KCreate a flag taking a required argument value, with a list of flag names, D an update function, the type of the argument and some help text. `OCreate an argument flag, with an update function and the type of the argument. aYCreate a boolean flag, with a list of flag names, an update function and some help text. =*+Embed a value 0Extract the mode and give a way of re-embedding ,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a8*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a *+,-./0123456789=<;:> ?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`aNoneb/Process a list of flags (usually obtained from getArgs/ expandArgsAt) with a mode. Returns  Left= and an error message if the command line fails to parse, or Right and  the associated value. bbbNonec'How to complete a command line option.  The 6 instance is suitable for parsing from shell scripts. d&Complete to a prefix, and a directory e!Complete to a prefix, and a file fComplete to a particular value g[Given a current state, return the set of commands you could type now, in preference order. cdefg,Mode specifying which arguments are allowed %Arguments the user has already typed W0-based index of the argument they are currently on, and the position in that argument cdefgcfedgNoneh9Unknown value, representing the values stored within the > structure. While the values G are not observable, they behave identically to the original values. i!Run a remote command line entry. j/Receive information about the mode to display. kfSend a reply with either an error, or a list of flags to use. This function exits the helper program. l\Send a comment which will be displayed on the calling console, mainly useful for debugging. hi!Name of the command to run, e.g.  echo argument, cmdargs-browser Mode to run remotely AInitial set of command line flags (not supported by all helpers) 3Either an error message, or a list of flags to use jklhijklihjklhijklNonemClass for default values. n!Provide a default value, such as (), False, 0, [], Nothing. mnmnmnmnNoneo8The data type representing some text, typically used as [Text]. The formatting  is described by:  qK values represent a paragraph of text, and may be wrapped depending on the r.  If a qG value is wrapped then all leading space will be treated as an indent.  p. values represent columns of text. Within any [Text] all columns of the same length c are grouped in tabs, with the final column being wrapped if necessary. All columns are placed a adjacent with no space between them - for this reason most columns will start with a space. rHow to output the text. s0Display as text wrapped at a certain width (see u). tDisplay as HTML. u.Wrap with the default width of 80 characters. v+Show some text using the given formatting. opqrstuvopqrstuvrtsuoqpvoqprtsuvNonew'Specify the format to output the help. xZ shell completion information yBash completion information zDisplay all modes. {Display only the first mode. |Equivalent to z* if there is not too much text, otherwise {. }FGenerate a help message from a mode. The first argument is a prefix, % which is prepended when not using y or x. wxyz{|}wxyz{|}w|{zyx}None~Process the flags obtained by  and ) with a mode. Displays R an error and exits with failure if the command line fails to parse, or returns 1 the associated value. Implemented in terms of b. This function makes / use of the following environment variables:  $CMDARGS_COMPLETE3 - causes the program to produce completions using g , then exit. * Completions are based on the result of -, the index of the current argument is taken  from $CMDARGS_COMPLETE (set it to -6 to complete the last argument), and the index within  that argument is taken from $CMDARGS_COMPLETE_POS (if set).  $CMDARGS_HELPER/$CMDARGS_HELPER_PROG2 - uses the helper mechanism for entering command ! line programs as described in System.Console.CmdArgs.Helper. /Process a list of flags (usually obtained from  and )) with a mode. Displays R an error and exits with failure if the command line fails to parse, or returns 2 the associated value. Implemeneted in terms of b. This function F does not take account of any environment variables that may be set  (see ~).  Create a help flag triggered by -?/--help.  Create a help flag triggered by -?/--help . The user A may optionally modify help by specifying the format, such as: * --help=all - help for all modes + --help=html - help in HTML format 7 --help=100 - wrap the text at 100 characters ; --help=100,one - full text wrapped at 100 characters #Create a version flag triggered by -V/ --version. $Create verbosity flags triggered by -v/ --verbose and  -q/--quiet ~N'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefgwxyz{|}~Nb~PONQIJKLMRS>?@ABCDEFGHTU9=<;:V81234567,-./0W*+XYZ[\]^_`aw|{zyx})('cfedg~None @Describes whether an option takes an argument or not, and if so 5 how the argument is injected into a value of type a. optional argument option requires argument no argument expected Each  describes a single option/flag. The arguments to  are: ! list of short option characters & list of long option strings (without "--", may not be 1 character long)  argument descriptor $ explanation of option for userdata /What to do with options following non-options. Changes: Only  is allowed, both  RequireOrder and  ReturnInOrder  have been removed. @Return a string describing the usage of a command, derived from A the header (first argument) and the options described by the  second argument. EProcess the command-line, and return the list of values that matched  (and those that didn't). The arguments are:  The order requirements (see )  The option descriptions (see ) 9 The actual command line arguments (presumably got from  ). = returns a triple consisting of the option arguments, a list 1 of non-options, and a list of error messages. Changes:> The list of errors will contain at most one entry, and if an < error is present then the other two lists will be empty. Changes: This is exactly the same as , but the 3rd element of the . tuple (second last) will be an empty list. @Given a help text and a list of option descriptions, generate a >. None#Any value, with a Data dictionary.       !            !None"#$%&'()*+,-./012"#$%&'()*+,-./012"#$%&'()*+,-./012None345678934567893456789None\This type represents an annotated value. The type of the underlying value is not specified. Add annotations to a field. Construct a field, fieldname := value. *The result of capturing some annotations. !A constructor (a constructor, or ) A missing field (a : exception, or missing from ) A value (just a value, or ) #An annotation attached to a value ( or ) Many values collapsed ( or ) #Return the value inside a capture. LRemove all Missing values by using any previous instances as default values $Collapse multiple values in to one. 5Capture a value. Note that if the value is evaluated 4 more than once the result may be different, i.e.  capture x /= capture x Add an annotation to a value. CIt is recommended that anyone making use of this function redefine H it with a more restrictive type signature to control the type of the H annotation (the second argument). Any redefinitions of this function B should add an INLINE pragma, to reduce the chance of incorrect  optimisations. Add an annotation to a value. *Collapse many annotated values in to one. $Lift a pure value to an annotation. Create a constructor/%record. The first argument should be H the type of field, the second should be a list of fields constructed  originally defined by := or :=+. GThis operation is not type safe, and may raise an exception at runtime - if any field has the wrong type or label. 1Capture the annotations from an annotated value. ;<;<None+=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefg'=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abc = B>CDEFG?@AHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefgNonehhhNoneiiiNone HTake impurely annotated records and run the corresponding command line.  Shortcut for  . . To use ( with custom command line arguments see  . FTake purely annotated records and run the corresponding command line.  Shortcut for  . . To use ( with custom command line arguments see  . 6Take impurely annotated records and turn them in to a > value, that can  make use of the System.Console.CmdArgs.Explicit functions (i.e. process). CAnnotated records are impure, and will only contain annotations on L their first use. The result of this function is pure, and can be reused. 4Take purely annotated records and turn them in to a > value, that can  make use of the System.Console.CmdArgs.Explicit functions (i.e. process). ERun a Mode structure. This function reads the command line arguments ! and then performs as follows: C If invalid arguments are given, it will display the error message  and exit.  If --help6 is given, it will display the help message and exit.  If  --version1 is given, it will display the version and exit. = In all other circumstances the program will return a value.  Additionally, if either --quiet or  --verbose is given (see ) $ it will set the verbosity (see ). ,Perform the necessary actions dictated by a   structure.  If # is Just-, it will display the help message and exit.  If $ is Just(, it will display the version and exit. 4 In all other circumstances it will return a value.  Additionally, if % is Just (see ) $ it will set the verbosity (see ). Modes: ":I want a program with multiple modes, like darcs or cabal." CTakes a list of modes, and creates a mode which includes them all. = If you want one of the modes to be chosen by default, see . 2 data Modes = Mode1 | Mode2 | Mode3 deriving Data % cmdArgs $ modes [Mode1,Mode2,Mode3] Flag: "II want several different flags to set this one field to different values." LThis annotation takes a type which is an enumeration, and provides multiple P separate flags to set the field to each value. The first element in the list & is used as the value of the field. % data State = On | Off deriving Data # data Mode = Mode {state :: State} M cmdArgs $ Mode {state = enum [On &= help "Turn on",Off &= help "Turn off"]}  --on Turn on  --off Turn off BAdd an annotation to a value. Note that if the value is evaluated H more than once the annotation will only be available the first time. Like ", but using the pure annotations. Like ", but using the pure annotations. :  !"#$%&>mn. !"#$%& > None Version of  without a ! context, only to be used within .  Version of  without a ! context, only to be used within .  Version of  without a ! context, only to be used within .  Version of  without a ! context, only to be used within .  Version of  without a ! context, only to be used within . 0Quotation function to turn an impure version of System.Console.CmdArgs.Implicit into a pure one.  For details see System.Console.CmdArgs.Quote. None:  !"#$%&>mnj ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 56789:;<=>? @ @ A B C D E F GHIJKKLMNOOPQRSTUVWXYZ[[\]^_`abcdeefghijklmnopqrstuvwxyz{|}~"w                k j        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHHIJKLMNOPQRSTUVRWXYZ[\\]^_`abbcdefghhijklmnopqrstuvwxyz{ cmdargs-0.9.5System.Console.CmdArgs.Implicit System.Console.CmdArgs.VerbositySystem.Console.CmdArgs.ExplicitSystem.Console.CmdArgs.HelperSystem.Console.CmdArgs.DefaultSystem.Console.CmdArgs.TextSystem.Console.CmdArgs.GetOptSystem.Console.CmdArgs.AnnotateSystem.Console.CmdArgs.Quote#System.Console.CmdArgs.Implicit.Ann"System.Console.CmdArgs.Implicit.UI$System.Console.CmdArgs.Implicit.Type)System.Console.CmdArgs.Explicit.SplitJoin,System.Console.CmdArgs.Explicit.ExpandArgsAt$System.Console.CmdArgs.Explicit.Type'System.Console.CmdArgs.Explicit.Process(System.Console.CmdArgs.Explicit.Complete$System.Console.CmdArgs.Explicit.HelpSystem.EnvironmentgetArgsData.Generics.AnyData.Generics.Any.Prelude&System.Console.CmdArgs.Implicit.Reader%System.Console.CmdArgs.Implicit.Local&System.Console.CmdArgs.Implicit.Reform&System.Console.CmdArgs.Implicit.GlobalwithArgsSystem.Console.CmdArgsbase Data.DataDataData.Typeable.InternalTypeableAnnopttyptypFiletypDirhelpnameargsargPos groupnamedetailssummaryautoprogramexplicitignore verbosityhelpArg versionArg verbosityArgs VerbosityLoudNormalQuiet setVerbosity getVerbosityisNormalisLoud whenNormalwhenLoudCmdArgs cmdArgsValue cmdArgsHelpcmdArgsVersioncmdArgsVerbositycmdArgsPrivatejoinArgs splitArgs expandArgsAtRemapremapArgargValueargType argRequireFlag flagNamesflagInfo flagValueflagTypeflagHelpUpdateFlagInfoFlagNone FlagOptRareFlagOptFlagReqModemodeGroupModes modeNames modeValue modeCheck modeReformmodeHelpmodeHelpSuffixmodeArgsmodeGroupFlagsGroup groupUnnamed groupHidden groupNamedFlagHelpHelpName parseBool fromGrouptoGroup modeModes modeFlags fromFlagOpt checkModeremap2 remapUpdate modeEmptymodemodesflagNoneflagOptflagReqflagArgflagBoolprocessComplete CompleteDir CompleteFile CompleteValuecompleteUnknownexecutereceivereplycommentDefaultdefTextColsLine TextFormatWrapHTML defaultWrapshowText HelpFormat HelpFormatZshHelpFormatBash HelpFormatAll HelpFormatOneHelpFormatDefaulthelpText processArgs processValueflagHelpSimpleflagHelpFormat flagVersionflagsVerbosityArgDescrOptArgReqArgNoArgOptDescrOptionArgOrderPermute usageInfogetOptgetOpt'convertAnyAnnotate:=+:=CaptureCtorMissingValueMany fromCapturedefaultMissingmanycapture&=+=many_atomrecordcapture_cmdArgscmdArgs_ cmdArgsMode cmdArgsMode_ cmdArgsRun cmdArgsApplyenumenum_modes_&=#modes# cmdArgsMode#cmdArgs#enum# cmdArgsQuoteProgVerbosityArgsProgVersionArg ProgHelpArg ProgVerbosity ProgProgram ProgSummaryModeHelpSuffix ModeDefaultFlagType FlagArgPosFlagArgs FlagOptional GroupNameIgnoreExplicitCmdArgsPrivatecmdArgsHasValueembedreembed incArgsSeen getArgsSeen$fShowCmdArgsPrivate$fFunctorCmdArgs $fRemapArg $fRemapFlag $fRemapMode $fMonoidGroup$fFunctorGroupGHC.ShowShow completeBash completeZsh$fShowComplete$fPackerFlagInfo $fPackerArg $fPackerFlag $fPackerMode $fPackerGroup $fPackerBool$fPackerEither $fPackerMaybe $fPacker(,) $fPackerInt $fPackerChar $fPackerValue $fPacker(->) $fPacker[] $fReadNoShow $fShowNoShow$fDefault(,,,,,,,,,)$fDefault(,,,,,,,,)$fDefault(,,,,,,,)$fDefault(,,,,,,)$fDefault(,,,,,)$fDefault(,,,,)$fDefault(,,,) $fDefault(,,) $fDefault(,)$fDefaultWord64$fDefaultWord32$fDefaultWord16$fDefaultWord8 $fDefaultWord$fDefaultInt64$fDefaultInt32$fDefaultInt16 $fDefaultInt8$fDefaultMaybe $fDefault[]$fDefaultDouble$fDefaultFloat$fDefaultInteger $fDefaultInt $fDefaultBool $fDefault() $fShowText$fDefaultTextFormat $fShowArg $fShowFlag $fShowMode$fDefaultHelpFormatAnyT FieldNameCtorName readTupleTypefromAnycasttoConstrtypeOf dataTypeOf isAlgType typeShell typeShellFulltypeNamectorfieldschildrencompose0 recomposectors decomposearitycomposegetFieldsetField $fShowAnyheadtailconsnulljust_nil_list_appendisStringisListisMaybeisTuplefromList fromMaybe fromTupleunittupleReader readerHelp readerBool readerParts readerReadreaderControl.Exception.Base RecConError$fExceptionExceptionInt$fFunctorCaptureFlag_Arg_flagArg_ flagArgPos flagArgOpt flagFieldflagFlag flagExplicit flagGroupflagEnumMode_ modeFlags_modeMode modeDefault modeGroup modeExplicitBuiltin_ builtinNamesbuiltinExplicit builtinHelp builtinGroupbuiltinSummaryProg_ progModes progSummary progProgramprogHelpprogVerbosityArgs progHelpArgprogVersionArgprogHelpOutputprogVersionOutputisFlag_errlocal$fDefaultFlag_$fDefaultMode_$fDefaultBuiltin_$fDefaultProg_reformglobal