B )%z55.5.0+dev0-2025-04-28/#Arg$specA;@@$Unit@$unit6@@@7@@@@@@@4../../stdlib/arg.mliP  P @@#ArgA@$Bool@$bool8@@@9@@@@@@@Q8:Q8R@@B@#Set&Stdlib;#ref:@@@@@@@@1R2R@@0C@%Clear&Stdlib=#ref5<@@@@@@@@ISJS@@HD@&String@&string>@@@f?@@@@@@@`TaT$@@_E@*Set_string&StdlibA#ref@@@@@@@@@xUUWyUUq@@wF@#Int@#intB@@@C@@@@@@@VV@@G@'Set_int&StdlibE#refD@@@@@@@@WW@@H@%Float@%floatF@@@G@@@@@@@X=?X=Y@@I@)Set_float&StdlibI#refH@@@@@@@@YY@@J@%Tuple$listK#ArgJ$spec@@@@@@@@ZZ@@K@&SymbolML@@@@@@ @N@@@O@@@@@@@\TV\T@@L@$Rest@P@@@-Q@@@@@@@'_(_0@@&M@(Rest_all @SSR@@@@@@IT@@@@@@@CaDa@@BN@&Expand!@U@@@%arrayWV@@@@@@@@@@`dhjadh@@_O@@@A@@@@@dO  @@@@b@@A@#key"B;@@@AX@@@/@@@@sntn@@@@rP@A@#doc#C;@@A(Y@@@7@@@@oo@@@@Q@A@)usage_msg$D;@@A7Z@@@?@@@@pp@@@@R@A@(anon_fun%E;@@.A@H[@@@G\@@@H@@I@@@@qq @@@@S@A@%parse&@`@#Arg]#key@@@U@#Arg^$spec@@@V@#Arg_#doc@@@W@@X@@@Z@#Arga(anon_fun@@@[@#Argb)usage_msg@@@\c@@@]@@^@@_@@`@s""t.h@@T@@-parse_dynamic'@&Stdlibh#ref$g@#Argd#key@@@a@#Arge$spec@@@b@#Argf#doc@@@c@@d@@@f@@@h@#Argi(anon_fun@@@i@#Argj)usage_msg@@@jJk@@@k@@l@@m@@n@DE@@CU@@*parse_argv('current&optionL&Stdlibm#refl@@@o@@@q@@@@on@@@r@@@t@s@#Argp#key@@@u@#Argq$spec@@@v@#Argr#doc@@@w@@x@@@z@#Argt(anon_fun@@@{@#Argu)usage_msg@@@|v@@@}@@~@@@@@@@@@HH~@@V@@2parse_argv_dynamic)'currentp&Stdlibx#refHw@@@@@@@@@@zy@@@@@@@&Stdlib#ref ~@#Arg{#key@@@@#Arg|$spec@@@@#Arg}#doc@@@@@@@@@@@@#Arg(anon_fun@@@@@@@-@@@@@@@@@@@@@@'( " ]@@&W@@=parse_and_expand_argv_dynamic*@&Stdlib#ref@@@@@@@&Stdlib#ref@@@@@@@@@@&Stdlib#ref@#Arg#key@@@@#Arg$spec@@@@#Arg#doc@@@@@@@@@@@@#Arg(anon_fun@@@@>@@@@@@@@@@@@@@@@@! ! !P!@@X@@,parse_expand+@@#Arg#key@@@@#Arg$spec@@@@#Arg#doc@@@@@@@@@#Arg(anon_fun@@@@#Arg)usage_msg@@@@@@@@@@@@@"Z"Z"l"@@Y@@±$Help,F##exnG@@@@@@A#5#5#5#M@@Z@B@±#Bad-G#@@@@@@A ## ##@@ [@B@%usage.@5@#Arg#key@@@à@#Arg$spec@@@Ġ@#Arg#doc@@@@@@@@@#Arg)usage_msg@@@P@@@@@@@@J$b$bK$b$@@I\@@,usage_string/@u@#Arg#key@@@͠@#Arg$spec@@@Π@#Arg#doc@@@@@@@@@#Arg)usage_msg@@@0@@@@@@@@%%%%@@]@@%align0%limitF@@@@@@@@#Arg#key@@@ؠ@#Arg$spec@@@٠@#Arg#doc@@@@@@@@@#Arg#key@@@ޠ@#Arg$spec@@@ߠ@#Arg#doc@@@@@@@@@@@@@&Y&Y&Y&@@^@@'current1&Stdlib#ref{@@@@@@@((((@@_@@(read_arg2@@@@@@@@@@@@@ ))!)*@@`@@)read_arg03@@@@@@@@@@@@@;*w*w<*w*@@:a@@)write_arg4@@@@@@@@@@@c@@@@@@@@]++^++B@@\b@@*write_arg05@@@@@@@@@@@@@@@@@@@,,,,E@@~c@@@3 "Parsing of command line arguments.@ This module provides a general mechanism for extracting options and arguments from the command line to the program. For example:@!  let usage_msg = "append [-verbose] [] ... -o " let verbose = ref false let input_files = ref [] let output_file = ref "" let anon_fun filename = input_files := filename::!input_files let speclist = [("-verbose", Arg.Set verbose, "Output debug information"); ("-o", Arg.Set_string output_file, "Set output file name")] let () = Arg.parse speclist anon_fun usage_msg; (* Main functionality here *) @ Q Syntax of command lines: A keyword is a character string starting with a !- ^. An option is a keyword alone or followed by an argument. The types of keywords are: $Unit", $Bool", #Set", %Clear&, &String", *Set_string", #Int", 'Set_int", %Float", )Set_float&, %Tuple", &Symbol", $Rest", (Rest_all% and &Expand!.@% $Unit", #Set% and %Clear; keywords take no argument.@' A $Rest$ or (Rest_all ] keyword takes the remainder of the command line as arguments. (More explanations below.)@ Every other keyword takes the following word on the command line as argument. For compatibility with GNU getopt_long, +keyword=arg ] is also allowed. Arguments not preceded by a keyword are called anonymous arguments.@. Examples (#cmd $ is assumed to be the command name):" 4cmd -flag /(a unit option)@" 4cmd -int 1 =(an int option with argument !1!)@" 4cmd -string foobar ?(a string option with argument ("foobar"!)@" 4cmd -float 12.34 >(a float option with argument %12.34!)@" 4cmd a b c <(three anonymous arguments: #"a"", #"b"&, and #"c"!)@" 4cmd a b -- c d Y(two anonymous arguments and a rest option with two arguments)@@% $Rest Z takes a function that is called repeatedly for each remaining command line argument. (Rest_all T takes a function that is called once, with the list of all remaining arguments.@ ( Note that if no arguments follow a $Rest O keyword then the function is not called at all whereas the function for a (Rest_all * keyword is called with an empty list.@@@@@@@@@@@5unsynchronized_access nThe Arg module relies on a mutable global state, parsing functions should only be called from a single domain.@A4../../stdlib/arg.mli#(Arg.spec3 GThe concrete type describing the behavior associated with a keyword.@@@@@@@@@@@@@ב@@3 $Call the function with unit argument@@@@@@@@@@@@ȑ@@3 &Call the function with a bool argument@@@@@@@@@@@@@@39Set the reference to true@@@@@@@@@@@@@@3:Set the reference to false@@@@@@@@@@@@@@3 (Call the function with a string argument@@@@@@@@@@@@@@3 (Set the reference to the string argument@@@@@@@@@@@@@@3 &Call the function with an int argument@@@@@@@@@@@@wv@@3 %Set the reference to the int argument@@@@@@@@@@@@ih@@3 'Call the function with a float argument@@@@@@@@@@@@\[@@3 'Set the reference to the float argument@@@@@@@@@@@@NM@@3 TTake several arguments according to the spec list@@@@@@@@@@@@?>3@@3 lTake one of the symbols as argument and call the function with the symbol@@@@@@@@@@@@('@@3 pStop interpreting keywords and call the function with each remaining argument@@@@@@@@@@@@@@3 pStop interpreting keywords and call the function with all remaining arguments@@@@@@@@@@@@  @@3 If the remaining arguments to process are of the form 6["-foo"; "arg"] @ rest I where "foo" is registered as (Expand f @, then the arguments .f "arg" @ rest v are processed. Only allowed in =parse_and_expand_argv_dynamic!.@@@@@@@@@@@@@A@@@@#'Arg.key@@@A@  @@#'Arg.doc@@@A @@@#-Arg.usage_msg@@@A@@@#,Arg.anon_fun@@@A@@@)Arg.parse3 %Arg.parse speclist anon_fun usage_msg> parses the command line. (speclist6 is a list of triples 0(key, spec, doc)&. #key - is the option keyword, it must start with a #'-'0 character. $spec g gives the option type and the function to call when this option is found on the command line. #doc / is a one-line description of this option. (anon_fun 8 is called on anonymous arguments. The functions in $spec% and (anon_fun P are called in the same order as their arguments appear on the command line.@9 If an error occurs, )Arg.parse U exits the program, after printing to standard error an error message as follows: M The reason for the error: unknown option, invalid or missing argument, etc.@" )usage_msg@ : The list of options, each followed by the corresponding #doc 0 string. Beware: options that have an empty #doc - string will not be included in the list.@@ P For the user to be able to specify anonymous arguments starting with a !-6, include for example ;("-", String anon_fun, doc)$ in (speclist!.@1 By default, %parse> recognizes two unit options, %-help% and &--help *, which will print to standard output )usage_msg p and the list of options, and exit the program. You can override this behaviour by specifying your own %-help% and &--help, options in (speclist!.@@@@@@@@@@@@@ @u@n@@@@c1Arg.parse_dynamic3(Same as D@2, except that the (speclist argument is a reference and may be updated during the parsing. A typical use for this feature is to parse command lines of the form:7 command subcommand 'options O where the list of options depends on the value of the subcommand argument.@@@@@@$4.01@@@@@@@~@0@3Q@6J@@@@?.Arg.parse_argv3 8Arg.parse_argv ~current args speclist anon_fun usage_msg4 parses the array $args E as if it were the command line. It uses and updates the value of (~current0 (if given), or +Arg.currentD@ $. You must set it before calling *parse_argv8. The initial value of 'current U is the index of the program name (argument 0) in the array. If an error occurs, .Arg.parse_argv( raises 'Arg.BadG@ 2 with the error message as argument. If option %-help$ or &--help- is given, .Arg.parse_argv( raises (Arg.HelpG@ % with the help message as argument.@@@@@@@@@@@@@@s@i@D@=@@@@26Arg.parse_argv_dynamic3(Same as lD@2, except that the (speclist L argument is a reference and may be updated during the parsing. See D@!.@@@@$4.01@@@@@@@G@GF@5@+@@@@@@ !Arg.parse_and_expand_argv_dynamic3(Same as 8D@2, except that the $argv F argument is a reference and may be updated during the parsing of &Expand4 arguments. See JD@!.@@@@$4.05@@@@@@@ @ @@@@@@@@0Arg.parse_expand3(Same as D@2, except that the &Expand # arguments are allowed and the ĐD@: reference is not updated.@@@@$4.05@@@@@@@@ @#@&@@@@3*Raised by .Arg.parse_argv= when the user asks for help.@@@@@@@@@@@@@@@@@@Ӑ3-Functions in $spec$ or (anon_fun+ can raise 'Arg.Bad < with an error message to reject invalid arguments. 'Arg.Bad3 is also raised by $D@5 in case of an error.@@@@@@@@@@@@@@@@@@)Arg.usage3 prints in case of error. (speclist% and )usage_msg5 are the same as for 6D@!.@@@@@@@@@@@@@@@@@@0Arg.usage_string3 4Returns the message that would have been printed by 6D@ +, if provided with the same parameters.@@@@@@@@@@@@@@y@@@@n)Arg.align3 >Align the documentation strings by inserting spaces at the first alignment separator (tab or, if tab is not found, space), according to the length of the keyword. Use a alignment separator as the first character in a doc string if you want to align the whole string. The doc strings corresponding to &Symbol ( arguments are aligned on the next line.@@@@@@@%limit -options with keyword and message longer than %limit / will not be used to compute the alignment.@@@@@@@   @|@@@@23-Position (in (Sys.argv@@ Q) of the argument being processed. You can change this value, e.g. to force D@= to skip some arguments. D@; uses the initial value of D@ h as the index of argument 0 (the program name) and starts parsing arguments at the next element.@@@@@@@@@@@@J@@@@>,Arg.read_arg31Arg.read_arg file ? reads newline-terminated command line arguments from file $file!.@@@@$4.05@@@@@@@J@K@@@@=-Arg.read_arg03-Identical to #D@ B but assumes null character terminated command line arguments.@@@@$4.05@@@@@@@F@'G@@@@9-Arg.write_arg37Arg.write_arg file args6 writes the arguments $args & newline-terminated into the file $file=. If any of the arguments in $args= contains a newline, use .Arg.write_arg0D@) instead.@@@@$4.05@@@@@@@X@TY@WU@@@@G3-Identical to 8D@ C but uses the null character for terminator instead of newline.@@@@$4.05@@@@@@@O@mP@pL@@@@>@@ @@A@@@@@