Caml1999I037,^+Stdlib__Arg$spec6;@@$Unit@$unitF@@@d@@@e@@f@@'arg.mliP  P  @@A@$Bool@$boolE@@@a@@@b@@c@@QQ7@@4B@#Set&Stdlib#ref@@@_@@@`@@.Rjl/Rj}@@KC@%Clear#ref0@@@]@@@^@@BSCS@@_D@&String@&stringQ@@@Z^@@@[@@\@@XTYT @@uE@*Set_stringA#ref@@@X@@@Y@@lU:<mU:V@@F@#Int@#intA@@@U@@@V@@W@@VV@@G@'Set_intk#ref@@@S@@@T@@WW@@H@%Float@%floatD@@@P@@@Q@@R@@X"$X">@@I@)Set_float#ref@@@N@@@O@@YprYp@@J@%Tuple$listK@@@L@@@M@@ZZ@@K@&Symbol@@@J@@@K@@@@G@@@H@@I@@\9;\9e@@L@$Rest@@@@D @@@E@@F@@__@@$M@(Rest_all @I@@@@@@@A&@@@B@@C@@ a!a@@=N@&Expand!@@@@<%arrayJ@@@=@@@>@@?@@;dMO<dMs@@XO@@@A@@@@@?O  @@@@[@@A@#key7;@@@A@@@g@@@@MnNn@@@@jP@A@#doc8;@@@A @@@h@@@@\o]o@@@@yQ@A@)usage_msg9;@@@A@@@i@@@@kplp@@@@R@A@(anon_fun:;@@@A@*@@@j@@@k@@l@@@@qq@@@@S@A@%parse;@@R@@@o@@@@n@N@@@m@@p@@@q@7@@@r@L@@@s@@@t@@u@@v@@w@stM@@T@@-parse_dynamic<@#ref@8@@@z@@@@y@7@@@x@@{@@@|@@@}@7@@@~@6@@@@@@@@@@@@@@@U@@*parse_argv='current&optionL#ref@@@@@@@@@@ؠ@@@@@@@I@@@@@P@@@@@@@@@@@@@@@@@@@@=@@@@@@@@@@@@@@7--8c@@TV@@2parse_argv_dynamic>'currentO&#ref@@@@@@@@@@$ @@@@@@@>#ref@@@@@@@@@@@@@@@@@@@@@@@@@4@@@@@@@@@@@@@@@@@  B@@W@@=parse_and_expand_argv_dynamic?@t#ref"@@@@@@@#refv\@@@@@@@@@@#ref@,@@@@@@@@+@@@@@@@@@@@@+@@@@@@@@@@@@@@@@@@@@@  !5!p@@X@@,parse_expand@@@]@@@@%@@@@\@@@@@@@@@[@@@@Z@@@@@@@@@@@@@ "?"? "Q"@@)Y@@ $HelpA##exnG@@@@@@A&_none_@@A@;Z@B@ #BadB#@@@@@@A@G[@B@%usageC@k@@@@ˠ@r@@@ʠ@@@@@@@@@@@@@Z@@@@@@@@T$G$GU$G$@@q\@@,usage_stringD@@@@@Ԡ@@@@Ӡ@@@@@@@@@@@@@,@@@@@@@@~%%%%@@]@@%alignE%limit@@@@@@@ˠ@ @@@ߠ@@@@ޠ@ @@@@@@@@@ @@@䠠@@@@㠠@@@@@@@@@@@@@@&>&>&>&@@^@@'currentF#refW@@@@@@@(w(w(w(@@_@@(read_argG@@@@@@@@@@@@@))))@@ `@@)read_arg0H@@@@ˠ@@@@@@@@@*\*\*\*@@!a@@)write_argI@@@@@@@@@@@(@@@@@@@@"**#*+'@@?b@@*write_arg0J@@@@@@@@@@@F@@@@@@@@@++A+,*@@]c@@@i9.+Stdlib__Arg0اp2/٠r)w&Stdlib0Lku]8_٠8CamlinternalFormatBasics0%FU(Q/Tu@/@5unsynchronized_access nThe Arg module relies on a mutable global state, parsing functions should only be called from a single domain.@A@Caml1999T0372U>KC+Stdlib__Arg*ocaml.text&_none_@@A  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 *) ]} 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): - [cmd -flag ](a unit option) - [cmd -int 1 ](an int option with argument [1]) - [cmd -string foobar ](a string option with argument ["foobar"]) - [cmd -float 12.34 ](a float option with argument [12.34]) - [cmd a b c ](three anonymous arguments: ["a"], ["b"], and ["c"]) - [cmd a b -- c d ](two anonymous arguments and a rest option with two arguments) [Rest] takes a function that is called repeatedly for each remaining command line argument. [Rest_all] takes a function that is called once, with the list of all remaining arguments. Note that if no arguments follow a [Rest] keyword then the function is not called at all whereas the function for a [Rest_all] keyword is called with an empty list. 'arg.mliP77H # %@@@@@@3@@@@@@#intA;@@@A@@@@@:@A@$charB;@@A@@@@@>@A@&stringQ;@@ A@@@@@B@@@%bytesC;@@ A@@@@@F@@@%floatD;@@A@@@@@J@@@$boolE;@@%falsec@@T@$trued@@Z@@@A@@@@@[@A@$unitF;@@"()e@@e@@@A@@@@@f@A@ #exnG;@@@A@@@@@j@@@#effH;@@O@A@A@@@@@@s@@@,continuationI;@@Q@@P@B@A@nY@@@@@@@@@%arrayJ;@@R@A@A@@@@@@@@@ $listK;@@S@A"[]f@@@"::g@@@T@@@ @@A@Y@@@@@@@@&optionL;@@V@A$Noneh@@@$Somei@@@@@A@Y@@@@@@@@)nativeintM;@@A@@@@@@@@%int32N;@@A@@@@@@@@%int64O;@@A@@@@@@@@&lazy_tP;@@X@AJA@Y@@@@@@@@5extension_constructorR;@@A@@@@@@@@*floatarrayS;@@A@@@@@@@@&iarrayT;@@Y@A[A@Y@@@@@@@@*atomic_locU;@@Z@AdA@@@@@@@@@.Assert_failure`#@@@@@J@@@@@@@@[@@A=ocaml.warn_on_literal_pattern @ @0Division_by_zero]#@@@A  @+End_of_file\#$@@@A@'FailureY#,@'@@A!$$@0Invalid_argumentX#5@0@@A*$-#-@-Match_failureV#>@@=@9@;@@a@@A;5>4>@)Not_foundZ#O@@@AC=F<F@-Out_of_memoryW#W@@@AKENDN@.Stack_overflow^#_@@@ASMVLV@.Sys_blocked_io_#g@@@A[U^T^@)Sys_error[#o@j@@Ad^g]g@:Undefined_recursive_modulea#x@@w@s@u@@h@@Auoxnx@:Continuation_already_takenb#@@@A}wv@&Stdlib@Ax%alert~J ' +J ' 0@5unsynchronized_accessJ ' 1J ' F@@@@@ nThe Arg module relies on a mutable global state, parsing functions should only be called from a single domain.K G LL  @@K G KL  @@@@@@@@@@J ' 'M  @@A+$specAO  O  @@;@@$Unit@k@@@o@@@@@@@P  P  @)ocaml.docӐ & Call the function with unit argument P  P @@@@@@@A@$Bool@@@@@@@@@@@QQ7@$ ( Call the function with a bool argument Q<Qi@@@@@@@ B@#Set#ref@@@@@@@@RjlRj}@F; Set the reference to true RjRj@@@@@@@-C@%Clear#ref@@@@@@@@(S)S@h< Set the reference to false 6S7S@@@@@@@OD@&String@@@@@@@@@@@JTKT @ * Call the function with a string argument XT YT9@@@@@@@qE@*Set_string#ref7@@@@@@@@lU:<mU:V@ * Set the reference to the string argument zU:Y{U:@@@@@@@F@#Int@_@@@=@@@@@@@VV@ΐ ( Call the function with an int argument VV@@@@@@@G@'Set_int4#ref@@@@@@@@WW@𐠠 ' Set the reference to the int argument WW!@@@@@@@H@%Float@@@@@@@@@@@X"$X">@ ) Call the function with a float argument X"AX"o@@@@@@@I@)Set_floatx#ref@@@@@@@@YprYp@4 ) Set the reference to the float argument YpYp@@@@@@@J@%Tuplek@@@@@@@@ZZ@U V Take several arguments according to the spec list #Z$[ 8@@@@@@@Rjy@@?Y@@@EZ:@@@@<Q:9@99@@@9@9@#55PSQS@@г78YS1@г9$boolaSbS@@A}@@@G~<@@@@>u<;@;;@@@;@;@#77tTuT@@б@г9&stringTT@@A@@г>$unitTT@@F@@M @@@@DBA@AA@@@A@A@#==U:>U:H@"@г?@U:S9@гA&stringU:LU:R@@Iɰ@@@OʰD@@@@FDC@CC@@@C@C@#??VV@$@б@гA#intVV@@I@@гF$unitVV@@N@@U @@@@L鐠JI@II@@@I@I@#EEWW@*@гGHWA@гI#intWW@@Q@@@WL@@@@N; LK@KK@@@K@K@#GG X"& X"+@,@б@гI%floatX"0X"5@@Q4@@гN$unit!X"9"X"=@@V=@@]> @@@@Tc5RQ@QQ@@@Q@Q@#MM4Ypt5Yp}@2@гOP=YpI@гQ%floatEYpFYp@@Ya@@@_bT@@@@VYTS@SS@@@S@S@#OOXZYZ@5@гQ$listbZM@гU$specjZkZ@@]@@@bX@@@@Z~XW@WW@@@W@W@#SS}\9=~\9C@.@гU$list\9N\9R@гZ&string\9G\9M@@b@@@g @@б@г_&string\9V\9\@@g@@гd$unit\9`\9d@@l°@@sð @@@@jhg@gg@@@g@g@#cc__@H@б@гe&string__ @@m@@гj$unit__@@r@@y @@@@p␠nm@mm@@@m@m@#iiaa@I@б@гk$listaa@гp&stringaa@@x@@@} @@гu$unitaa@@}@@@@@@{Byx@xx@@@x@x@#ttdMQdMW@T@б@гv&stringdM\ dMb@@~;@@г{%array(dMm)dMr@г&string1dMf2dMl@@M@@@N @@O @@@@tF@@@@@@@A@Q~}@}}@@@}@}@@I@A+#key"BVnWn@@;@@@A,@@@/@@@@`nan@@@@yP@@@Aг &stringjn @@3hgghhhhh@h;@@@A$@@@4@.@@@@@@@@A@@@@3uttuuuuu@ @A@A+#doc#Coo@@;@@-AX@@@7@@@@oo@@@@Q@@@Aг &stringo @@3@-HB;@@@A#@@@<@6@@@@@@@@A@@@@3@ @A@A+)usage_msg$Dpp@@;@@YA@@@?@@@@pp@@@@R@@@Aг &stringp @@3@-GA;@@@A#@@@D@>@@@@@@@@A@@@@3@ @A@A+(anon_fun%Eqq@@;@@A@@@@G@@@H@@I@@@@qq@@@@S@@@Aб@г&stringqq@@3@6PJ$;@@@A,@@@R@F@@@@@@@@A@@г $unit q q@@(@@/@@&@@3        @@A'&@%parse&s s@б@г$list$t(%t,@В@гܠ#key2t3t@@ @@@U343344444@?b\@A@@@г$specCtDt @@ @@@V@@@гϠ#docRt#St&@@ @@@W @@@@(@@ @@X)/@@@D @@@Z.ftB@@б@г(anon_funpt0qt8@@ @@@[>@@б@гР)usage_msgt<tE@@ @@@\M@@г9$unittItM@@ @@@]Z@@@@@^]@@@%@@_`( @@@9@@`c5@@@s@ܐ = [Arg.parse speclist anon_fun usage_msg] parses the command line. [speclist] is a list of triples [(key, spec, doc)]. [key] is the option keyword, it must start with a ['-'] character. [spec] 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] is called on anonymous arguments. The functions in [spec] and [anon_fun] are called in the same order as their arguments appear on the command line. If an error occurs, [Arg.parse] exits the program, after printing to standard error an error message as follows: - The reason for the error: unknown option, invalid or missing argument, etc. - [usage_msg] - The list of options, each followed by the corresponding [doc] string. Beware: options that have an empty [doc] string will not be included in the list. For the user to be able to specify anonymous arguments starting with a [-], include for example [("-", String anon_fun, doc)] in [speclist]. By default, [parse] recognizes two unit options, [-help] and [--help], which will print to standard output [usage_msg] and the list of options, and exit the program. You can override this behaviour by specifying your own [-help] and [--help] options in [speclist]. uNN@@@@@@@T@@!@@@@@@@-parse_dynamic'@б@гT#ref@гR$list@В@г#key@@ @@@a3@P@A@@@гJ$spec@@ @@@b@@@г#doc@@ @@@c @@@@(@@ @@d)/@@@D @@@f.B@@@T @@@h4Q@@б@гL(anon_fun'(@@ @@@iC@@б@г)usage_msg67@@ @@@jR@@г$unitCD@@ @@@k_@@@@@lb@@@%@@me( @@@8@@nh:@@@T@ A Same as {!Arg.parse}, 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: - command subcommand [options] where the list of options depends on the value of the subcommand argument. @since 4.01 ab)+@@@@@@@zU@@!@u@@@@@@*parse_argv(x-1y-;@б'currentг #ref-L-O@гb#int-H-K@@ @@@o3@D@A@@@ @@@q @@б@г+%array-Z-_@гy&string-S-Y@@ @@@r @@@@@@t% @@б@г?$listcxc|@В@г{#keycfci@@ @@@uB@@@г5$specclcp@@ @@@vQ@@@гl#doccscv@@ @@@w`@@@@&@@ @@xi-@@@B @@@zn ce@@@б@г2(anon_fun c c@@ @@@{~@@б@гm)usage_msg c c@@ @@@|@@г֠$unit )c *c@@ @@@}@@@@@~@@@%@@( @@@9@@5@@@@@@@@@@ @@ C->@@ @ F--@ % [Arg.parse_argv ~current args speclist anon_fun usage_msg] parses the array [args] as if it were the command line. It uses and updates the value of [~current] (if given), or {!Arg.current}. You must set it before calling [parse_argv]. The initial value of [current] is the index of the program name (argument 0) in the array. If an error occurs, [Arg.parse_argv] raises {!Arg.Bad} with the error message as argument. If option [-help] or [--help] is given, [Arg.parse_argv] raises {!Arg.Help} with the help message as argument.  S T@@@@@@@ lV@@-@ g@@@@@@2parse_argv_dynamic) j k@б'currentг#ref w x@г T#int  @@ @@@3        @D@A@@@ @@@ @@б@г %array   @г k&string  @@ @@@ @@@@@@% @@б@г=#ref   !   $@г ;$list      @В@гw#key      @@ @@@L@@@г1$spec      @@ @@@[@@@гh#doc      @@ @@@j@@@@&@@ @@s-@@@B @@@x   @@@@R @@@~O@@б@г3(anon_fun   (   0@@ @@@@@б@г 砐&string   4   :@@ @@@@@г נ$unit *  > +  B@@ @@@@@@@@@@@%@@( @@@8@@:@@@@@@@@@@ @@ C@@ @ F@ Same as {!Arg.parse_argv}, except that the [speclist] argument is a reference and may be updated during the parsing. See {!Arg.parse_dynamic}. @since 4.01  S C C T  @@@@@@@ lW@@,@ g@@@@@@=parse_and_expand_argv_dynamic* j   k !@б@г#ref u ! v !@г R#int  !  !@@ @@@3        @ B@A@@@ @@@ @@б@г #ref  !.  !1@г %%array  !(  !-@г s&string  !!  !'@@ @@@*@@@@@@/ @@@&@@@4#@@б@г J#ref !5!O !5!R@г H$list !5!J !5!N@В@г#key !5!8 !5!;@@ @@@[@@@г >$spec !5!> !5!B@@ @@@j@@@гu#doc !5!E !5!H@@ @@@y@@@@&@@ @@-@@@B @@@ !5!7@@@@R @@@O@@б@г@(anon_fun !5!V !5!^@@ @@@@@б@г &string *!5!b +!5!h@@ @@@@@г 䠐$unit 7!5!l 8!5!p@@ @@@@@@@@@@@%@@( @@@8@@:@@@@@İ@@@@@ǰ@@@ N  @ Same as {!Arg.parse_argv_dynamic}, except that the [argv] argument is a reference and may be updated during the parsing of [Expand] arguments. See {!Arg.parse_argv_dynamic}. @since 4.05  [!q!q \";"=@@@@@@@ tX@@'@  o@@@@@@,parse_expand+ r"?"C s"?"O@б@г $list }"Q"f ~"Q"j@В@г5#key "Q"T "Q"W@@ @@@3        @ ,F@A@@@г $spec "Q"Z "Q"^@@ @@@@@@г(#doc "Q"a "Q"d@@ @@@ @@@@(@@ @@)/@@@D @@@. "Q"SB@@б@г(anon_fun "Q"n "Q"v@@ @@@>@@б@г))usage_msg "Q"z "Q"@@ @@@M@@г $unit "Q" "Q"@@ @@@Z@@@@@]@@@%@@`( @@@9@@c5@@@ "?"?@ 5 Same as {!Arg.parse}, except that the [Expand] arguments are allowed and the {!current} reference is not updated. @since 4.05  "" ##@@@@@@@ Y@@!@ E @@@@@@$Help,F ##$ ##(@# 8@ @@@@@A %## &##2@ e 9 Raised by [Arg.parse_argv] when the user asks for help.  3#3#3 4#3#q@@@@@@@ LZ@@г&string ?##,@@ 3 = < < = = = = =@N@A@@@@  S@@@@@@*@*)@#Bad-G X#s#} Y#s#@# u@ .@@@@@A b#s#s c#s#@ Functions in [spec] or [anon_fun] can raise [Arg.Bad] with an error message to reject invalid arguments. [Arg.Bad] is also raised by {!Arg.parse_argv} in case of an error.  p## q#$E@@@@@@@ [@@г&string |#s#@@ 3 z y y z z z z z@>hb@A@@@@  @@@@@@*@*)@%usage. $G$K $G$P@б@г $list $G$f $G$j@В@гW#key $G$T $G$W@@ @@@3        @6`Z@A@@@г $spec $G$Z $G$^@@ @@@@@@гJ#doc $G$a $G$d@@ @@@ @@@@(@@ @@)/@@@D @@@. $G$SB@@б@г<)usage_msg $G$n $G$w@@ @@@>@@г $unit $G${ $G$@@ @@@K@@@@@N@@@'@@Q# @@@ $G$G@ E  [Arg.usage speclist usage_msg] prints to standard error an error message that includes the list of valid options. This is the same message that {!Arg.parse} prints in case of error. [speclist] and [usage_msg] are the same as for {!Arg.parse}.  $$ %C%@@@@@@@ ,\@@@ U '@@@@@@p,usage_string/ *%% +%%@б@г $list 5%% 6%%@В@г#key C%% D%%@@ @@@3 E D D E E E E E@F@A@@@г $spec T%% U%%@@ @@@@@@гࠐ#doc c%% d%%@@ @@@ @@@@(@@ @@)/@@@D @@@. w%%B@@б@гҠ)usage_msg %% %%@@ @@@>@@г X&string %% %%@@ @@@K@@@@@N@@@'@@Q# @@@ %%@ ې m Returns the message that would have been printed by {!Arg.usage}, if provided with the same parameters.  %% &&<@@@@@@@ ]@@@  @@@@@@p%align0 &>&B &>&G@б%limitг #int &>&Q &>&T@@ @@@3        @:@A@@б@г Z$list &>&k &>&o@В@г#key &>&Y &>&\@@ @@@@@@г P$spec &>&_ &>&c@@ @@@.@@@г#doc &>&f &>&i@@ @@@=@@@@&@@ @@F-@@@B @@@K&>&X@@@г $list&&>&'&>&@В@гޠ#key4&>&t5&>&w@@ @@@g@@@г $specC&>&zD&>&~@@ @@@v@@@гϠ#docR&>&S&>&@@ @@@@@@@&@@ @@-@@@B @@@f&>&s@@@@P@@LC@@/@@@ @@q&>&IK@@ @t&>&>N@  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. @param limit options with keyword and message longer than [limit] will not be used to compute the alignment. &&(M(u@@@@@@@^@@^@ @@@@@@'current1(w({(w(@г )#ref(w((w(@г~#int(w((w(@@ @@@3@@@A@@@ @@@ @@@(w(w@ 1 Position (in {!Sys.argv}) of the argument being processed. You can change this value, e.g. to force {!Arg.parse} to skip some arguments. {!Arg.parse} uses the initial value of {!Arg.current} as the index of argument 0 (the program name) and starts parsing arguments at the next element. (())@@@@@@@_@@)@ ې@@@@@@&(read_arg2))))@б@г&string))))@@ @@@3@?\8@A@@г~%array))))@г̠&string))))@@ @@@@@@@@@ @@@$@@!'@@@))@ Q k [Arg.read_arg file] reads newline-terminated command line arguments from file [file]. @since 4.05 )) *H*Z@@@@@@@8`@@*@ a3@@@@@@@)read_arg036*\*`7*\*i@б@г &stringA*\*kB*\*q@@ @@@3CBBCCCCC@Yn8@A@@г֠%arrayP*\*|Q*\*@г$&stringZ*\*u[*\*{@@ @@@@@@@@@ @@@$@@!'@@@j*\*\@ p Identical to {!Arg.read_arg} but assumes null character terminated command line arguments. @since 4.05 w**x**@@@@@@@a@@*@ @@@@@@@)write_arg4***+@б@гc&string*+ *+@@ @@@3@Yn8@A@@б@г0%array*+*+@г~&string*+*+@@ @@@@@@@@@  @@гs$unit*+#*+'@@ @@@-@@@@@0@@@6@@39 @@@**@ [Arg.write_arg file args] writes the arguments [args] newline-terminated into the file [file]. If any of the arguments in [args] contains a newline, use {!Arg.write_arg0} instead. @since 4.05 +(+(++@@@@@@@b@@@#@@@@@@R*write_arg05+,+, @б@г͠&string+, +,@@ @@@3@k8@A@@б@г%array+,+,"@г蠐&string+,+,@@ @@@@@@@@@  @@гݠ$unit0+,&1+,*@@ @@@-@@@@@0@@@6@@39 @@@>++@} r Identical to {!Arg.write_arg} but uses the null character for terminator instead of newline. @since 4.05 K,+,+L,,@@@@@@@dc@@@_@@@@@@R@A@  A@  A@  A@  A@ Q@@&@(@"@|@[UB@ B@r@R@@@n@N@@H@@3@}J@A@ H************************************************************************A@@A@L@ H BMMBM@ H OCaml CC@ H DD3@ H Damien Doligez, projet Para, INRIA Rocquencourt E44E4@ H FF@ H Copyright 1996 Institut National de Recherche en Informatique et GG@ H en Automatique. HHg@ H IhhIh@ H All rights reserved. This file is distributed under the terms of JJ@ H the GNU Lesser General Public License version 2.1, with the KKN@ H special exception on linking described in the file LICENSE. LOOLO@ H MM@ H************************************************************************NN5@ * 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 *) ]} 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): - [cmd -flag ](a unit option) - [cmd -int 1 ](an int option with argument [1]) - [cmd -string foobar ](a string option with argument ["foobar"]) - [cmd -float 12.34 ](a float option with argument [12.34]) - [cmd a b c ](three anonymous arguments: ["a"], ["b"], and ["c"]) - [cmd a b -- c d ](two anonymous arguments and a rest option with two arguments) [Rest] takes a function that is called repeatedly for each remaining command line argument. [Rest_all] takes a function that is called once, with the list of all remaining arguments. Note that if no arguments follow a [Rest] keyword then the function is not called at all whereas the function for a [Rest_all] keyword is called with an empty list. ޠ '* Call the function with unit argument  )* Call the function with a bool argument <* Set the reference to true Ӡ=* Set the reference to false  +* Call the function with a string argument  +* Set the reference to the string argument v )* Call the function with an int argument W (* Set the reference to the int argument 8 ** Call the function with a float argument  ** Set the reference to the float argument  W* Take several arguments according to the spec list  ܠ o* Take one of the symbols as argument and call the function with the symbol  s* Stop interpreting keywords and call the function with each remaining argument  s* Stop interpreting keywords and call the function with all remaining arguments  p * If the remaining arguments to process are of the form [["-foo"; "arg"] @ rest] where "foo" is registered as [Expand f], then the arguments [f "arg" @ rest] are processed. Only allowed in [parse_and_expand_argv_dynamic].  L J* The concrete type describing the behavior associated with a keyword.  > >* [Arg.parse speclist anon_fun usage_msg] parses the command line. [speclist] is a list of triples [(key, spec, doc)]. [key] is the option keyword, it must start with a ['-'] character. [spec] 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] is called on anonymous arguments. The functions in [spec] and [anon_fun] are called in the same order as their arguments appear on the command line. If an error occurs, [Arg.parse] exits the program, after printing to standard error an error message as follows: - The reason for the error: unknown option, invalid or missing argument, etc. - [usage_msg] - The list of options, each followed by the corresponding [doc] string. Beware: options that have an empty [doc] string will not be included in the list. For the user to be able to specify anonymous arguments starting with a [-], include for example [("-", String anon_fun, doc)] in [speclist]. By default, [parse] recognizes two unit options, [-help] and [--help], which will print to standard output [usage_msg] and the list of options, and exit the program. You can override this behaviour by specifying your own [-help] and [--help] options in [speclist].  g B* Same as {!Arg.parse}, 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: - command subcommand [options] where the list of options depends on the value of the subcommand argument. @since 4.01  &* [Arg.parse_argv ~current args speclist anon_fun usage_msg] parses the array [args] as if it were the command line. It uses and updates the value of [~current] (if given), or {!Arg.current}. You must set it before calling [parse_argv]. The initial value of [current] is the index of the program name (argument 0) in the array. If an error occurs, [Arg.parse_argv] raises {!Arg.Bad} with the error message as argument. If option [-help] or [--help] is given, [Arg.parse_argv] raises {!Arg.Help} with the help message as argument. Ġ * Same as {!Arg.parse_argv}, except that the [speclist] argument is a reference and may be updated during the parsing. See {!Arg.parse_dynamic}. @since 4.01 Ǡ * Same as {!Arg.parse_argv_dynamic}, except that the [argv] argument is a reference and may be updated during the parsing of [Expand] arguments. See {!Arg.parse_argv_dynamic}. @since 4.05   * Same as {!Arg.parse}, except that the [Expand] arguments are allowed and the {!current} reference is not updated. @since 4.05  :* Raised by [Arg.parse_argv] when the user asks for help.  * Functions in [spec] or [anon_fun] can raise [Arg.Bad] with an error message to reject invalid arguments. [Arg.Bad] is also raised by {!Arg.parse_argv} in case of an error.  * [Arg.usage speclist usage_msg] prints to standard error an error message that includes the list of valid options. This is the same message that {!Arg.parse} prints in case of error. [speclist] and [usage_msg] are the same as for {!Arg.parse}.  n* Returns the message that would have been printed by {!Arg.usage}, if provided with the same parameters.  * 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. @param limit options with keyword and message longer than [limit] will not be used to compute the alignment.  2* Position (in {!Sys.argv}) of the argument being processed. You can change this value, e.g. to force {!Arg.parse} to skip some arguments. {!Arg.parse} uses the initial value of {!Arg.current} as the index of argument 0 (the program name) and starts parsing arguments at the next element. k l* [Arg.read_arg file] reads newline-terminated command line arguments from file [file]. @since 4.05  q* Identical to {!Arg.read_arg} but assumes null character terminated command line arguments. @since 4.05  * [Arg.write_arg file args] writes the arguments [args] newline-terminated into the file [file]. If any of the arguments in [args] contains a newline, use {!Arg.write_arg0} instead. @since 4.05 Z s* Identical to {!Arg.write_arg} but uses the null character for terminator instead of newline. @since 4.05 @?)../ocamlc0-strict-sequence(-absname"-w5+a-4-9-41-42-44-45-48"-g+-warn-error"+A*-bin-annot)-nostdlib*-principal"-o/stdlib__Arg.cmi"-cKL D/builds/workspace/precheck/flambda/false/label/ocaml-linux-32/stdlib @@0 w=k Og3POOPPPPP@N@@8CamlinternalFormatBasics0%FU(Q/Tu&Stdlib0Lku]8_٠v0اp2/٠r)w@0اp2/٠r)wAd { @S A@h@ĐKm A@; '@  @@@@# @@O  1@@ ɒ @@(! @4  @Xx   @n ?@@@@@  @D5J "@!  ͒@@ > @V@3Sœ @Ѱ  @  @@P@@