0b$      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  None%&,/29:;ADHIT[\A 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. @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.wThe 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 .+Specifies whether we accept 0-1 or 0-n for  CmdParserParts.BInformation about an error that occured when trying to parse some Input using some  CmdParser.!!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.)$Empty  * value. Mostly for butcher-internal usage.B  !"#$%A  !"#$%   !"#$%None %&9:;DHT[\#  !"#$%# %!"#  $ None%&,/29:;ADHIQRT[\&lAdd 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.'qAdd 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.(Like ' . PP.text)ESemi-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.*Semi-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.+uAdd part that is expected to occur exactly once in the input. May succeed on empty input (e.g. by having a default).,PAdd part that is not required to occur, and can occur as often as indicated by ". Must not succeed on empty input.-uAdd 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..PAdd 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.//Add a new child command in the current context.0Add 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.1/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.2'Create a simple PartDesc from a string.3Add 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.4-Add an implementation to the current command.5Best 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.6See 57Because 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.8Run 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).9Like 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.:#The Applicative-enabled version of 8.;#The Applicative-enabled version of 9.< map over the out type argument4&'()*+,-./ command name subcommand0 command name subcommand1234567top-level command nameparser to check8*program name to be used for the top-level  CommandDescinput to be processed parser to use9*program name to be used for the top-level  CommandDescinput to be processed parser to use:*program name to be used for the top-level  CommandDescinput to be processed parser to use;*program name to be used for the top-level  CommandDescinput to be processed parser to use<&'()*+,-./0123456789:;<*&'()*+,-./0123456789:;<None %&9:;DHT[\=param-description monoid. You probably won't need to use the constructor; mzero or any (<>) of param(Help|Default|Suggestion) works well.B Create a = with just a help text.C Create a = with just a help text.D Create a = with just a default value.E Create a =' with just a list of suggestion values.F Create a = that is a file path.G Create a = that is a directory path.HAdd 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.JHLike addReadParam, but optional. I.e. if reading fails, returns Nothing.LAdd 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.NLike LM, but optional, I.e. succeeding with Nothing if there is no remaining input.PAdd 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.RLike Lf but does not match strings starting with a dash. This prevents misinterpretation of flags as params.SLike Nf but does not match strings starting with a dash. This prevents misinterpretation of flags as params.TLike Pf but does not match strings starting with a dash. This prevents misinterpretation of flags as params.UAdd a parameter that consumes _all_ remaining input. Typical usecase is after a "--" as common in certain (unix?) commandline tools.WFAdd a parameter that consumes _all_ remaining input, returning a raw ! value.=>?@ABCDEFGH+paramater name, for use in usage/help texts propertiesI+paramater name, for use in usage/help texts propertiesJ+paramater name, for use in usage/help texts propertiesK+paramater name, for use in usage/help texts propertiesLMNOPQRSTUVWXY=>?@ABCDEFGHIJKLMNOPQRSTUVW=>?@ACBDEFGHJLNPRSTUWIKMOQV=>?@ABCDEFGHIJKLMNOPQRSTUVWXYNone %&9:;DHT[\ ZppUsage exampleDesc yields: 'example [--short] NAME [version | help][#ppUsageShortSub exampleDesc yields:  example [--short] NAME <command>+I.e. Subcommands are abbreviated using the  command! label, instead of being listed.\#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.] ppUsageAt [] = ppUsage4fromJust $ ppUsageAt ["version"] exampleDesc yields: example version [--porcelain]^!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 properly_"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 properly`0Internal helper; users probably won't need this.a0Internal helper; users probably won't need this.bSimple conversion from  to . Z[\]^_`ab Z[\]^_`ab Z[]^_\`ab Z[\]^_`abNone %&9:;DHT[\cFDerives a potential completion from a given input string and a given  V. Considers potential subcommands and where available the completion info present in s.dJDerives 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.e 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.fTObtains a list of "expected"/potential strings for a command part described in the . In constrast to the c 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.TObtains a list of "expected"/potential strings for a command part described in the . In constrast to the c 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.c input string)CommandDesc obtained on that input stringF"remaining" input after the last successfully parsed subcommand. See  .^completion, i.e. a string that might be appended to the current prompt when user presses tab.d input string)CommandDesc obtained on that input stringF"remaining" input after the last successfully parsed subcommand. See  .e input string)CommandDesc obtained on that input stringF"remaining" input after the last successfully parsed subcommand. See  .max length of help textfcdefcdefcdefNone %&9:;DHT[\g#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 ()).hSame as mainFromCmdParser, but with one additional twist: You get access to a knot-tied complete CommandDesc for this full command. Useful in combination with  ghghghghNone$%&9:;DHIT[\ i}flag-description monoid. You probably won't need to use the constructor; mzero or any (<>) of flag(Help|Default) works well.n Create a i with just a help text.o Create a i with just a help text.p Create a i with just a default value.q Create a it 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.rJA no-parameter flag where non-occurence means False, occurence means True.sApplicative-enabled version of  addSimpleFlagtaA no-parameter flag that can occur multiple times. Returns the number of occurences (0 or more).uFOne-argument flag, where the argument is parsed via its Read instance.vOne-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].Applicative-enabled version of u 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 actw@One-argument flag where the argument can be an arbitrary string.xOne-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"].ijklmnopqr!short flag chars, i.e. "v" for -v$list of long names, e.g. ["verbose"] propertiess!short flag chars, i.e. "v" for -v$list of long names, e.g. ["verbose"] properties'action to execute whenever this matchest!short flag chars, i.e. "v" for -v$list of long names, i.e. ["verbose"] propertiesu!short flag chars, i.e. "v" for -v$list of long names, i.e. ["verbose"] param name propertiesv!short flag chars, i.e. "v" for -v$list of long names, i.e. ["verbose"] param name properties!short flag chars, i.e. "v" for -v$list of long names, i.e. ["verbose"] param name properties(action to execute when ths param matchesw!short flag chars, i.e. "v" for -v$list of long names, i.e. ["verbose"] param name propertiesx!short flag chars, i.e. "v" for -v$list of long names, i.e. ["verbose"] param name propertiesyzijklmnopqrstuvwxijklmnopqrtsuvwxijklmnopqrstuvwxyzNone %&9:;DHT[\Safe wrapper around 'reorderStart'/'reorderStop'F for cases where reducing to a single binding is possible/preferable.@&'()*+,-./0123456=>?@ABCDEFGHIJKLMNOPQRSTUVWijklmnopqrstuvwx/034&'(56)*+,-.12 None %&9:;DHT[\/Adds a proper full help command. To obtain the   value, see  or . raddHelpCommand = addHelpCommandWith (pure . PP.renderStyle PP.style { PP.ribbonsPerLine = 1.0 } . ppHelpShallow)0Adds 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)aAdds a proper full help command, using the specified function to turn the relevant subcommand's   into a String.JAdds 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.%Prints the raw CommandDesc structure.6Adds the "completion" command and several subcommands.1This command can be used in the following manner: *$ source <(foo completion bash-script foo)5Adds the "completion" command and several subcommands1This command can be used in the following manner: *$ source <(foo completion bash-script foo)None %&9:;DHT[\Like 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.Wrapper 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. *program name to be used for the top-level  CommandDescinput to be processed parser to usel  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWZ[\]^_`abcdefghijklmnopqrstuvwx!"# %89:;7<$                 ! " # $ % & ' ( ) * + , - - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I JKKLMNOPQRSTUVWXYZ[\]^_`abcdef ghijklmnopqrsttuvwxyz{|}~                                  &butcher-1.3.2.2-A1mCub6yQbb5FJRvA6q9iXUI.Butcher.Monadic.TypesUI.Butcher.Monadic.CommandUI.Butcher.MonadicUI.Butcher.Monadic.ParamUI.Butcher.Monadic.PrettyUI.Butcher.Monadic.InteractiveUI.Butcher.Monadic.IOUI.Butcher.Monadic.Flag"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 runCmdParserArunCmdParserAExtmapOutParam_param_default _param_help_param_suggestions paramHelpStr paramHelp paramDefaultparamSuggestions paramFileparamDirectory addParamRead addReadParamaddParamReadOptaddReadParamOptaddParamStringaddStringParamaddParamStringOptaddStringParamOptaddParamStringsaddStringParamsaddParamNoFlagStringaddParamNoFlagStringOptaddParamNoFlagStringsaddParamRestOfInputaddRestOfInputStringParamaddParamRestOfInputRaw $fMonoidParam$fSemigroupParamppUsageShortSubppUsageWithHelp ppUsageAt ppHelpShallowppHelpDepthOneppPartDescUsageppPartDescHeaderparsingErrorStringsimpleCompletionshellCompletionWordsinteractiveHelpDocpartDescStringsmainFromCmdParserFlag _flag_help _flag_default_flag_visibilityflagHelp flagHelpStr flagDefault flagHiddenaddSimpleBoolFlagaddSimpleFlagAaddSimpleCountFlagaddFlagReadParamaddFlagReadParamsaddFlagStringParamaddFlagStringParams $fMonoidFlag$fSemigroupFlag$fFunctorInpParseString$fApplicativeInpParseString$fMonadInpParseString$fMonadStateInpParseString$fAlternativeInpParseString$fMonadPlusInpParseString withReorderaddHelpCommand2addHelpCommandWithaddHelpCommandShallowaddButcherDebugCommandaddShellCompletionCommandaddShellCompletionCommand'runCmdParserWithHelpDescrunCmdParserSimple $fShowSamplebaseGHC.BaseMonadCompletionItemCompletionStringCompletionDirectoryCompletionFile CmdParserF CmdParserHelpCmdParserSynopsisCmdParserPeekDescCmdParserPeekInput CmdParserPartCmdParserPartManyCmdParserPartInpCmdParserPartManyInpCmdParserChild CmdParserImplCmdParserReorderStartCmdParserReorderStopCmdParserGroupedCmdParserGroupEndCmdParserAlternatives addSuggestion$fShowCommandDesc cmd_childrencmd_help cmd_mParent cmd_parts cmd_synopsiscmd_visibilityPastCommandInput CmdDescStack StackBottom StackLayerPartParsedData ChildGatherPartGatherData_pgd_id _pgd_desc _pgd_parseF_pgd_act _pgd_manymModify.=+%=+ addCmdPartAaddCmdPartManyAaddCmdPartInpAaddCmdPartManyInpA descStackAdddequeLookupRemovetakeCommandChild wrapBoundDescdescFixParentsdescFixParentsWithTopM _tooLongTextGHC.ReadRead appendParamStringpretty-1.1.3.3Text.PrettyPrint.HughesPJDocpartDescCompletions putStrErrLnprintErraddFlagReadParamsAllInpParseStringrunInpParseStringpExpect pExpectEofpOption appendFlag wrapHiddenaddSimpleBoolFlagAlladdFlagStringParamsAllcompletionScriptBashSample_hello_s1_s2_quiet_cmds_test2_test3