!:10      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  None&'.14=>?EHLMX_`butcherA representation/description of a command's parts, i.e. flags or params. As a butcher user, the higher-level pretty-printing functions for   are probably sufficient. butcher@A representation/description of a command parser built via the K monad. Can be transformed into a pretty Doc to display as usage/help via   and related functions.Note that there is the  accessor that contains  Maybe out1 which might be useful after successful parsing.butcherwThe CmdParser monad type. It is a free monad over some functor but users of butcher don't need to know more than that  is a .butcher+Specifies whether we accept 0-1 or 0-n for  CmdParserParts.butcherBInformation about an error that occured when trying to parse some Input using some  CmdParser.!butcher!Butcher supports two input modi: String and [String]. Program arguments have the latter form, while parsing interactive command input (e.g. when you implement a terminal of sorts) is easier when you can process the full Stringq without having to wordify it first by some means (and List.words is not the right approach in many situations.)$butcherEmpty  * value. Mostly for butcher-internal usage.A  !"#$% None&'.14=>?EHLMUVX_`u&butcherlAdd a synopsis to the command currently in scope; at top level this will be the implicit top-level command.>Adding a second synopsis will overwrite a previous synopsis; 7: will check that you don't (accidentally) do this however.'butcherqAdd a help document to the command currently in scope; at top level this will be the implicit top-level command.>Adding a second document will overwrite a previous document; 7: will check that you don't (accidentally) do this however.(butcherLike ' . PP.text)butcherESemi-hacky way of accessing the output CommandDesc from inside of a {. This is not implemented via knot-tying, i.e. the CommandDesc you get is _not_ equivalent to the CommandDesc returned by 8 . Also see runCmdParserWithHelpDesc which does knot-tying.(For best results, use this "below" any /? invocations in the current context, e.g. directly before the 4 invocation.*butcherSemi-hacky way of accessing the current input that is not yet processed. This must not be used to do any parsing. The purpose of this function is to provide a String to be used for output to the user, as feedback about what command was executed. For example we may think of an interactive program reacting to commandline input such as "run --delay 60 fire-rockets" which shows a 60 second delay on the "fire-rockets" command. The latter string could have been obtained via *. after having parsed "run --delay 60" already.+butcheruAdd part that is expected to occur exactly once in the input. May succeed on empty input (e.g. by having a default).,butcherPAdd part that is not required to occur, and can occur as often as indicated by ". Must not succeed on empty input.-butcheruAdd part that is expected to occur exactly once in the input. May succeed on empty input (e.g. by having a default).Only difference to + is that it accepts !#, i.e. can behave differently for String and [String] input..butcherPAdd part that is not required to occur, and can occur as often as indicated by ". Must not succeed on empty input.Only difference to + is that it accepts !#, i.e. can behave differently for String and [String] input./butcher/Add a new child command in the current context.0butcherAdd a new child command in the current context, but make it hidden. It will not appear in docs/help generated by e.g. the functions in the Pretty module.$This feature is not well tested yet.1butcher/Add a list of sub-parsers one of which will be selected and used based on the provided predicate function. The input elements consist of: a) a name used for the command description of the output, b) a predicate function; the first True predicate determines which element to apply c) a CmdParser.2butcher'Create a simple PartDesc from a string.3butcherAdd a new nameless child command in the current context. Nameless means that this command matches the empty input, i.e. will always apply. This feature is experimental and CommandDesc pretty-printing might not correctly in presense of nullCmds.4butcher-Add an implementation to the current command.5butcherBest explained via example: do reorderStart bright <- addSimpleBoolFlag "" ["bright"] mempty yellow <- addSimpleBoolFlag "" ["yellow"] mempty reorderStop ..Xwill accept any inputs "" "--bright" "--yellow" "--bright --yellow" "--yellow --bright".~This works for any flags/params, but bear in mind that the results might be unexpected because params may match on any input.cNote that start/stop must occur in pairs, and it will be a runtime error if you mess this up. Use 7) if you want to check all parts of your 5 without providing inputs that provide 100% coverage.6butcherSee 57butcherBecause butcher is evil (i.e. has constraints not encoded in the types; see the README), this method can be used as a rough check that you did not mess up. It traverses all possible parts of the  thereby ensuring that the  has a valid structure.%This method also yields a _complete_  CommandDescq output, where the other runCmdParser* functions all traverse only a shallow structure around the parts of the ) touched while parsing the current input.8butcherRun a  CmdParser on the given input, returning:a) A CommandDesc () that accurately represents the subcommand that was reached, even if parsing failed. Because this is returned always, the argument is ()+ because "out" requires a successful parse.b) Either an error or the result of a successful parse, including a proper "CommandDesc out" from which an "out" can be extracted (presuming that the command has an implementation).9butcherLike 8, but also returning all input after the last successfully parsed subcommand. E.g. for some input "myprog foo bar -v --wrong" where parsing fails at "--wrong", this will contain the full "-v --wrong". Useful for interactive feedback stuff.:butcher#The Applicative-enabled version of 8.;butcher#The Applicative-enabled version of 9.<butcher map over the out type argument/butcher command namebutcher subcommand0butcher command namebutcher subcommand7butchertop-level command namebutcherparser to check8butcher*program name to be used for the top-level  CommandDescbutcherinput to be processedbutcher parser to use9butcher*program name to be used for the top-level  CommandDescbutcherinput to be processedbutcher parser to use:butcher*program name to be used for the top-level  CommandDescbutcherinput to be processedbutcher parser to use;butcher*program name to be used for the top-level  CommandDescbutcherinput to be processedbutcher parser to use&'()*+,-./0123456789:;<None%&'=>?HLMX_`< =butcher}flag-description monoid. You probably won't need to use the constructor; mzero or any (<>) of flag(Help|Default) works well.Bbutcher Create a = with just a help text.Cbutcher Create a = with just a help text.Dbutcher Create a = with just a default value.Ebutcher Create a =t marked as hidden. Similar to hidden commands, hidden flags will not included in pretty-printing (help, usage etc.)$This feature is not well tested yet.FbutcherJA no-parameter flag where non-occurence means False, occurence means True.GbutcherApplicative-enabled version of  addSimpleFlagHbutcheraA no-parameter flag that can occur multiple times. Returns the number of occurences (0 or more).IbutcherFOne-argument flag, where the argument is parsed via its Read instance.JbutcherOne-argument flag, where the argument is parsed via its Read instance. This version can accumulate multiple values by using the same flag with different arguments multiple times.$E.g. "--foo 3 --foo 5" yields [3,5].butcherApplicative-enabled version of I addFlagReadParamA :: forall f p out . (Typeable p, Text.Read.Read p, Show p) => String -- ^ short flag chars, i.e. "v" for -v -> [String] -- ^ list of long names, i.e. ["verbose"] -> String -- ^ param name -> Flag p -- ^ properties -> (p -> f ()) -- ^ action to execute when ths param matches -> CmdParser f out () addFlagReadParamA shorts longs name flag act = void $ addFlagReadParamsAll shorts longs name flag actKbutcher@One-argument flag where the argument can be an arbitrary string.LbutcherOne-argument flag where the argument can be an arbitrary string. This version can accumulate multiple values by using the same flag with different arguments multiple times.1E.g. "--foo abc --foo def" yields ["abc", "def"].Fbutcher!short flag chars, i.e. "v" for -vbutcher$list of long names, e.g. ["verbose"]butcher propertiesGbutcher!short flag chars, i.e. "v" for -vbutcher$list of long names, e.g. ["verbose"]butcher propertiesbutcher'action to execute whenever this matchesHbutcher!short flag chars, i.e. "v" for -vbutcher$list of long names, i.e. ["verbose"]butcher propertiesIbutcher!short flag chars, i.e. "v" for -vbutcher$list of long names, i.e. ["verbose"]butcher param namebutcher propertiesJbutcher!short flag chars, i.e. "v" for -vbutcher$list of long names, i.e. ["verbose"]butcher param namebutcher propertiesbutcher!short flag chars, i.e. "v" for -vbutcher$list of long names, i.e. ["verbose"]butcher param namebutcher propertiesbutcher(action to execute when ths param matchesKbutcher!short flag chars, i.e. "v" for -vbutcher$list of long names, i.e. ["verbose"]butcher param namebutcher propertiesLbutcher!short flag chars, i.e. "v" for -vbutcher$list of long names, i.e. ["verbose"]butcher param namebutcher properties=>?@ABCDEFGHIJKL=>?@ABCDEFHGIJKLNone &'=>?HLX_`Ubutcherparam-description monoid. You probably won't need to use the constructor; mzero or any (<>) of param(Help|Default|Suggestion) works well.Zbutcher Create a U with just a help text.[butcher Create a U with just a help text.\butcher Create a U with just a default value.]butcher Create a U' with just a list of suggestion values.^butcher Create a U that is a file path._butcher Create a U that is a directory path.`butcherAdd a parameter to the  by making use of a  instance. Take care not to use this to return Strings unless you really want that, because it will require the quotation marks and escaping as is normal for the Show/Read instances for String.bbutcherHLike addReadParam, but optional. I.e. if reading fails, returns Nothing.dbutcherAdd a parameter that matches any string of non-space characters if input==String, or one full argument if input==[String]. See the ! doc for this distinction.fbutcherLike dM, but optional, I.e. succeeding with Nothing if there is no remaining input.hbutcherAdd a parameter that matches any string of non-space characters if input==String, or one full argument if input==[String]. See the ! doc for this distinction.jbutcherLike df but does not match strings starting with a dash. This prevents misinterpretation of flags as params.kbutcherLike ff but does not match strings starting with a dash. This prevents misinterpretation of flags as params.lbutcherLike hf but does not match strings starting with a dash. This prevents misinterpretation of flags as params.mbutcherAdd a parameter that consumes _all_ remaining input. Typical usecase is after a "--" as common in certain (unix?) commandline tools.obutcherFAdd a parameter that consumes _all_ remaining input, returning a raw ! value.`butcher+paramater name, for use in usage/help textsbutcher propertiesabutcher+paramater name, for use in usage/help textsbutcher propertiesbbutcher+paramater name, for use in usage/help textsbutcher propertiescbutcher+paramater name, for use in usage/help textsbutcher propertiesUVWXYZ[\]^_`abcdefghijklmnoUVWXY[Z\]^_`bdfhjklmoaceginNone &'=>?HLX_`yrbutcherSafe wrapper around 'reorderStart'/'reorderStop'F for cases where reducing to a single binding is possible/preferable.@&'()*+,-./0123456=>?@ABCDEFGHIJKLUVWXYZ[\]^_`abcdefghijklmnor/034&'(56r)*+,-.12None &'=>?HLX_`I sbutcherppUsage exampleDesc yields: 'example [--short] NAME [version | help]tbutcher#ppUsageShortSub exampleDesc yields:  example [--short] NAME <command>+I.e. Subcommands are abbreviated using the  command! label, instead of being listed.ubutcher#ppUsageWithHelp exampleDesc yields: Qexample [--short] NAME [version | help]: a simple butcher example programKAnd yes, the line break is not optimal in this instance with default print.vbutcher ppUsageAt [] = ppUsage4fromJust $ ppUsageAt ["version"] exampleDesc yields: example version [--porcelain]wbutcher%Access a child command's CommandDesc.xbutcher!ppHelpShallow exampleDesc yields: NAME example - a simple butcher example program USAGE example [--short] NAME [version | help] DESCRIPTION a very long help document ARGUMENTS --short make the greeting short NAME your name, so you can be greeted properlyybutcher"ppHelpDepthOne exampleDesc yields: NAME example - a simple butcher example program USAGE example [--short] NAME <command> DESCRIPTION a very long help document COMMANDS version help ARGUMENTS --short make the greeting short NAME your name, so you can be greeted properlyzbutcher0Internal helper; users probably won't need this.{butcher0Internal helper; users probably won't need this.|butcherSimple conversion from  to . stuvwxyz{| stvxyuz{|wNone &'=>?HLX_`P}butcherFDerives a potential completion from a given input string and a given  V. Considers potential subcommands and where available the completion info present in s.~butcherJDerives a list of completion items from a given input string and a given  V. Considers potential subcommands and where available the completion info present in s.See addShellCompletion which uses this.butcher Produces a j as a hint for the user during interactive command input. Takes the current (incomplete) prompt line into account. For example when you have commands (among others) 'config set-email' and 'config get-email', then on empty prompt there will be an item 'config'; on the partial prompt 'config ' the help doc will contain the 'set-email' and 'get-email' items.butcherTObtains a list of "expected"/potential strings for a command part described in the . In constrast to the } function this function does not take into account any current input, and consequently the output elements can in general not be appended to partial input to form valid input.butcherTObtains a list of "expected"/potential strings for a command part described in the . In constrast to the } function this function does not take into account any current input, and consequently the output elements can in general not be appended to partial input to form valid input.}butcher input stringbutcher)CommandDesc obtained on that input stringbutcherF"remaining" input after the last successfully parsed subcommand. See  .butcher^completion, i.e. a string that might be appended to the current prompt when user presses tab.~butcher input stringbutcher)CommandDesc obtained on that input stringbutcherF"remaining" input after the last successfully parsed subcommand. See  .butcher input stringbutcher)CommandDesc obtained on that input stringbutcherF"remaining" input after the last successfully parsed subcommand. See  .butchermax length of help text}~}~None &'=>?HLX_` [butcher#Utility method that allows using a  as your main function: Xmain = mainFromCmdParser $ do addCmdImpl $ putStrLn "This is a fairly boring program."Uses System.Environment.getProgName as program name and System.Environment.getArgs as the input to be parsed. Prints some appropriate messages if parsing fails or if the command has no implementation; if all is well executes the 'out' action (the IO ()).butcherSame as mainFromCmdParser, but with one additional twist: You get access to a knot-tied complete CommandDesc for this full command. Useful in combination with   None &'=>?HLX_` butcher/Adds a proper full help command. To obtain the   value, see  or . raddHelpCommand = addHelpCommandWith (pure . PP.renderStyle PP.style { PP.ribbonsPerLine = 1.0 } . ppHelpShallow)butcher0Adds a proper full help command. In contrast to a, this version is a bit more verbose about available subcommands as it includes their synopses.To obtain the   value, see  or . taddHelpCommand2 = addHelpCommandWith (pure . PP.renderStyle PP.style { PP.ribbonsPerLine = 1.0 } . ppHelpDepthOne)butcheraAdds a proper full help command, using the specified function to turn the relevant subcommand's   into a String.butcherJAdds a help command that prints help for the command currently in context.uThis version does _not_ include further childcommands, i.e. "help foo" will not print the help for subcommand "foo".|This also yields slightly different output depending on if it is used before or after adding other subcommands. In general  should be preferred.butcher%Prints the raw CommandDesc structure.butcher6Adds the "completion" command and several subcommands.1This command can be used in the following manner: *$ source <(foo completion bash-script foo)butcher5Adds the "completion" command and several subcommands1This command can be used in the following manner: *$ source <(foo completion bash-script foo)None &'=>?HLX_` #  !"#$%# %!"#  $None &'=>?HLX_`/butcherLike 8, but with one additional twist: You get access to a knot-tied complete CommandDesc for this full command. Useful in combination with .Note that the CommandDesc ()F in the output is _not_ the same value as the parameter passed to the parser function: The output value contains a more "shallow" description. This is more efficient for complex CmdParsers when used interactively, because non-relevant parts of the CmdParser are not traversed unless the parser function argument is forced.butcherWrapper around 8! for very simple usage: Accept a StringX input and return only the output from the parser, or a plain error string on failure.butcher*program name to be used for the top-level  CommandDescbutcherinput to be processedbutcher parser to usem  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLUVWXYZ[\]^_`abcdefghijklmnorstuvwxyz{|}~!"# %89:;7<$                 ! " # $ % & ' ( ) * + , - - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I JKKLMNOPQRSTUVWXYZ[\]^_`abbcdefghijklmnopqrstuvwxyz{|}~                        %butcher-1.3.3.2-9orqxDSb2FEi9RRgxCcIFUI.Butcher.Monadic.TypesUI.Butcher.Monadic.CommandUI.Butcher.MonadicUI.Butcher.Monadic.FlagUI.Butcher.Monadic.ParamUI.Butcher.Monadic.PrettyUI.Butcher.Monadic.InteractiveUI.Butcher.Monadic.IO"UI.Butcher.Monadic.BuiltinCommands!UI.Butcher.Monadic.Internal.TypesppUsage UI.Butcher.Monadic.Internal.CorerunCmdParserExtaddHelpCommandcmdRunParserWithHelpDescmainFromCmdParserWithHelpDescPartDesc PartLiteral PartVariable PartOptionalPartAltsPartSeq PartDefaultPartSuggestion PartRedirect PartReorderPartMany PartWithHelp PartHidden CommandDesc _cmd_mParent _cmd_synopsis _cmd_help _cmd_parts_cmd_out _cmd_children_cmd_visibility CmdParser VisibilityVisibleHiddenManyUpperBoundManyUpperBound1ManyUpperBoundN ParsingError _pe_messages _pe_remainingInput InputString InputArgsemptyCommandDesccmd_outaddCmdSynopsis addCmdHelp addCmdHelpStr peekCmdDesc peekInput addCmdPartaddCmdPartMany addCmdPartInpaddCmdPartManyInpaddCmd addCmdHiddenaddAlternatives varPartDesc addNullCmd addCmdImpl reorderStart reorderStopcheckCmdParser runCmdParser runCmdParserArunCmdParserAExtmapOutFlag _flag_help _flag_default_flag_visibilityflagHelp flagHelpStr flagDefault flagHiddenaddSimpleBoolFlagaddSimpleFlagAaddSimpleCountFlagaddFlagReadParamaddFlagReadParamsaddFlagStringParamaddFlagStringParams $fMonoidFlag$fSemigroupFlag$fFunctorInpParseString$fApplicativeInpParseString$fMonadInpParseString$fMonadStateInpParseString$fAlternativeInpParseString$fMonadPlusInpParseStringParam_param_default _param_help_param_suggestions paramHelpStr paramHelp paramDefaultparamSuggestions paramFileparamDirectory addParamRead addReadParamaddParamReadOptaddReadParamOptaddParamStringaddStringParamaddParamStringOptaddStringParamOptaddParamStringsaddStringParamsaddParamNoFlagStringaddParamNoFlagStringOptaddParamNoFlagStringsaddParamRestOfInputaddRestOfInputStringParamaddParamRestOfInputRaw $fMonoidParam$fSemigroupParam withReorderppUsageShortSubppUsageWithHelp ppUsageAt descendDescTo ppHelpShallowppHelpDepthOneppPartDescUsageppPartDescHeaderparsingErrorStringsimpleCompletionshellCompletionWordsinteractiveHelpDocpartDescStringsmainFromCmdParseraddHelpCommand2addHelpCommandWithaddHelpCommandShallowaddButcherDebugCommandaddShellCompletionCommandaddShellCompletionCommand'runCmdParserWithHelpDescrunCmdParserSimple $fShowSamplebaseGHC.BaseMonadCompletionItemCompletionStringCompletionDirectoryCompletionFile CmdParserF CmdParserHelpCmdParserSynopsisCmdParserPeekDescCmdParserPeekInput CmdParserPartCmdParserPartManyCmdParserPartInpCmdParserPartManyInpCmdParserChild CmdParserImplCmdParserReorderStartCmdParserReorderStopCmdParserGroupedCmdParserGroupEndCmdParserAlternatives addSuggestion cmd_childrencmd_help cmd_mParent cmd_parts cmd_synopsiscmd_visibility addCmdPartAaddCmdPartManyAaddCmdPartInpAaddCmdPartManyInpAaddFlagReadParamsAllGHC.ReadReadStringpretty-1.1.3.6Text.PrettyPrint.HughesPJDocpartDescCompletions