J      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~EThe general type of annotations that can be associated with a value.  Flag: "8I want users to be able to omit the value for 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) 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 Modes: "!My program needs verbosity flags." Add  --verbose and --quiet flags.    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 .    ,The number of arguments that have been seen 5A structure to store the additional data relating to --help,   --version, --quiet and  --verbose. $The underlying value being wrapped. Just if --help4 is given, then gives the help message for display. Just if --verion7 is given, then gives the version message for display. !Just if --quiet or  --verbose, is given, then gives the verbosity to use. "3Private: Only exported due to Haddock limitations.  !"  !" !" 4#$Embed a value 0Extract the mode and give a way of re-embedding %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 )BA flag, consisting of a list of flag names and other information. *+The names for the flag. ,Information about a flag' s arguments. -The way of processing a flag. .1The type of data for the flag argument, i.e. FILE/DIR/EXT /,The help message associated with this flag. 0NA function to take a string, and a value, and either produce an error message  (Left), or a modified value (Right). 1The 1! type has the following meaning: < FlagReq FlagOpt FlagOptRare/FlagNone 0 -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 2 No argument 36Optional argument that requires an = before the value 4Optional argument 5Required argument 6+A mode. Each mode has three main features:  A list of submodes (8)  A list of flags (?) ! Optionally an unnamed argument (>) 78The available sub-modes 9[The names assigned to this mode (for the root mode, this name is used as the program name) :Value to start with ;< Help text =,A longer help suffix displayed after a mode >An unnamed argument ?Groups of flags @LA group of items (modes or flags). The items are treated as a list, but the = group structure is used when displaying the help message. ABNormal items. C;Items that are hidden (not displayed in the help message). DFItems that have been grouped, along with a description of each group. EThe type of a flag, i.e. --foo=TYPE. F7A help message that goes with either a flag or a mode. G#A name, either the name of a flag (--foo) or the name of a mode. H:Parse a boolean, accepts as True: true yes on enabled 1. IConvert a group into a list. J3Convert a list into a group, placing all fields in B. KExtract the modes from a 76 LExtract the flags from a 76 M Extract the value from inside a 4 or 3, or raises an error. N"Check that a mode is well formed. OP[Create a mode with a name, an initial value, some help text, a way of processing arguments  and a list of flags. QcCreate a list of modes, with a program name, an initial value, some help text and the child modes. RVCreate a flag taking no argument value, with a list of flag names, an update function  and some help text. S_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. TKCreate 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. UOCreate an argument flag, with an update function and the type of the argument. VYCreate a boolean flag, with a list of flag names, an update function and some help text. 7#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUV4#$$%&'(&'()*+,-./*+,-./01543223456 789:;<=>?789:;<=>?@ABCDABCDEFGHIJKLMNOPQRSTUV WProcess the flags obtained by getArgs 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 Y. X/Process a list of flags (usually obtained from getArgs) 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 Y. Y/Process a list of flags (usually obtained from getArgs) with a mode. Returns  Left= and an error message if the command line fails to parse, or Right and  the associated value. WXYWXYZClass for default values. [!Provide a default value, such as (), False, 0, [], Nothing. Z[Z[Z[[ \8The data type representing some text, typically used as [Text]. The formatting  is described by:  ^K values represent a paragraph of text, and may be wrapped depending on the _.  If a ^G value is wrapped then all leading space will be treated as an indent.  ]. 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. ]^_How to output the text. `0Display as text wrapped at a certain width (see b). aDisplay as HTML. b.Wrap with the default width of 80 characters. c+Show some text using the given formatting. ;Split the text into strips of no-more than the given width \]^_`abc_a`b\^]c\^]]^_a``abc d'Specify the format to output the help. eDisplay all modes. fDisplay only the first mode. gEquivalent to e* if there is not too much text, otherwise f. h%Generate a help message from a mode. Help text for all modes ! <program> [OPTIONS] <file_args>  <options> + <program> MODE [SUBMODE] [OPTIONS] [FLAG] Help text for only this mode ! <program> [OPTIONS] <file_args>  <options>  <program> MODE [FLAGS]  <options> defghdgfeefghi Create a help flag triggered by -?/--help. j 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 k#Create a version flag triggered by -V/ --version. l$Create verbosity flags triggered by -v/ --verbose and  -q/--quiet A#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYdefghijkl@YXWGFEH@ABCDIJ6789:;<=>?KL15432M0)*+,-./%&'(N#$OPQRSTUVijkldgfehijkl m@Describes whether an option takes an argument or not, and if so 5 how the argument is injected into a value of type a. noptional argument ooption requires argument pno argument expected qEach q describes a single option/flag. The arguments to r 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 rs/What to do with options following non-options. Changes: Only t is allowed, both  RequireOrder and  ReturnInOrder  have been removed. tu@Return a string describing the usage of a command, derived from A the header (first argument) and the options described by the  second argument. vEProcess the command-line, and return the list of values that matched  (and those that didn't). The arguments are:  The order requirements (see s)  The option descriptions (see q) 9 The actual command line arguments (presumably got from  System.Environment.getArgs). v= 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. wChanges: This is exactly the same as v, but the 3rd element of the . tuple (second last) will be an empty list. x@Given a help text and a list of option descriptions, generate a 76. mnopqrstuvwx xvwustqrmpon mponnopqrrsttuvwxy#Any value, with a Data dictionary. zyzyzz  0Both Any will be the same type as ReadContainer 4If c is the container type, and a is the atom type: ! Type (c a) -> c a -> a -> c a %The Any will be the type as ReadAtom !  {\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. yz{|}~~yz{}|{}||}~# !"#$%&'()*+,-./0123456789:; !"#$%&'()*+,-./01<=>2  !"# !"#$%&'()*%&'()*+,-./01,-./012?@ABCDEA mode devoid of all it' s contents FA mode whose help hides all it' s contents GHIJKLMNOPQRSTCC HTake impurely annotated records and run the corresponding command line.  Shortcut for  . . FTake purely annotated records and run the corresponding command line.  Shortcut for  . . U6Take impurely annotated records and turn them in to a 6 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 6 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 2 separate flags to set the field to each value. % 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. 6  !"6Z[{}* !" {}6 6  !"6Z[{}V       ! " # $ % & ' ()*+,-./012 3 3 4 5 6 7 8 9 : ; ; < = > > ? @ A B C D E F G H I J J K L M N O P Q R S S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j klmnopqrstu v w x y z{|}~cYX                !"#$%&'())*+,-.//0123456789:;<=>?@@ABCDEFGHIJKLMNOPQRSTUV cmdargs-0.5System.Console.CmdArgs.Implicit System.Console.CmdArgs.VerbositySystem.Console.CmdArgs.ExplicitSystem.Console.CmdArgs.DefaultSystem.Console.CmdArgs.TextSystem.Console.CmdArgs.GetOptSystem.Console.CmdArgs.Annotate#System.Console.CmdArgs.Implicit.Ann"System.Console.CmdArgs.Implicit.UI$System.Console.CmdArgs.Implicit.Type$System.Console.CmdArgs.Explicit.Type'System.Console.CmdArgs.Explicit.Process$System.Console.CmdArgs.Explicit.HelpData.Generics.AnyData.Generics.Any.Prelude$System.Console.CmdArgs.Implicit.Read%System.Console.CmdArgs.Implicit.Local&System.Console.CmdArgs.Implicit.GlobalSystem.Console.CmdArgsbase Data.DataData Data.TypeableTypeableAnnopttyptypFiletypDirhelpnameargsargPos groupnamedetailssummaryautoprogramexplicit verbosity VerbosityLoudNormalQuiet setVerbosity getVerbosityisNormalisLoud whenNormalwhenLoudCmdArgs cmdArgsValue cmdArgsHelpcmdArgsVersioncmdArgsVerbositycmdArgsPrivateRemapremapArgargValueargTypeFlag flagNamesflagInfo flagValueflagTypeflagHelpUpdateFlagInfoFlagNone FlagOptRareFlagOptFlagReqModemodeGroupModes modeNames modeValue modeCheckmodeHelpmodeHelpSuffixmodeArgsmodeGroupFlagsGroup groupUnnamed groupHidden groupNamedFlagHelpHelpName parseBool fromGrouptoGroup modeModes modeFlags fromFlagOpt checkModeremap2modemodesflagNoneflagOptflagReqflagArgflagBool processArgs processValueprocessDefaultdefTextColsLine TextFormatWrapHTML defaultWrapshowText HelpFormat HelpFormatAll HelpFormatOneHelpFormatDefaulthelpTextflagHelpSimpleflagHelpFormat flagVersionflagsVerbosityArgDescrOptArgReqArgNoArgOptDescrOptionArgOrderPermute usageInfogetOptgetOpt'convertAnyAnnotate:=+:=CaptureCtorMissingValueMany fromCapturedefaultMissingmanycapture&=+=many_atomrecordcapture_cmdArgscmdArgs_ cmdArgsMode cmdArgsMode_ cmdArgsRun cmdArgsApplyenumenum_modes_ ProgVerbosity ProgProgram ProgSummaryModeHelpSuffix ModeDefaultFlagType FlagArgPosFlagArgs FlagOptional GroupNameExplicitrefCmdArgsPrivatecmdArgsHasValueembedreembed showRecord*= remapUpdate LookupNameFound AmbiguousNotFoundSvalerrs processModestoperrupd processFlags processFlag lookupNameshowWrapwrapshowHTML helpTextAll helpTextOne helpTextMode helpGrouphelpFlagAnyT FieldNameCtorName readTupleTypefromAnycasttoConstrtypeOf dataTypeOf isAlgType typeShell typeShellFulltypeNamectorfieldschildrencompose0 recomposectors decomposecomposegetFieldsetFieldarityheadtailconsnulljust_nil_appendunittupleisListisMaybeisTuplefromList fromMaybe fromTupleReadAtom ReadTupleReadEnum ReadString ReadDouble ReadFloat ReadIntegerReadIntReadBool ReadContainer ReadMaybeReadListfromReadContainertoReadContainer toReadAtom toReadEnumreader addContainerreadAtomreadEnum readTuplesplitflattenunconcatreadHelp isReadBool ExceptionIntACtorAAtomAManyAAnnControl.Exception.Base RecConErroraddAnnforceconst_id_ fieldIndexthrowIntcatchIntFlag_Arg_flagArg_ flagArgPos flagArgOpt flagFieldflagFlag flagExplicit flagGroupflagEnumMode_ modeFlags_modeMode modeDefault modeGroup modeExplicitProg_ progModes progSummary progProgramprogHelp progVerbositylocalprog_mode_flag_value_progAnnmodeAnnflagAnntoArgprogSummisFlag_Nameshavewantglobalcollapse emptyModezeroMode collapseMode collapseFlags collapseArgs orderArgs assignGroups assignCommongroupSplitCommon extraFlagssetHelp changeHelp assignNamesnames duplicatesnamesOncmdArgsCapture