You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
30 KiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>InferBase__CommandLineOption (InferBase.InferBase__CommandLineOption)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><meta name="generator" content="doc-ock-html v1.0.0-1-g1fc9bf0"/></head><body><nav id="top"><a href="../index.html">Up</a> &mdash; <span class="package">package <a href="../index.html">InferBase</a></span></nav><header><h1><span class="keyword">Module</span> <span class="module-path">InferBase__CommandLineOption</span></h1></header><p>Definition and parsing of command line arguments</p><div class="spec val" id="val-warnf"><a href="#val-warnf" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>warnf : (<span class="type-var">'a</span>, Format.formatter, unit) <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.format <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span></code></div><div class="doc"><p>Print to stderr in case of error, fails in strict mode</p></div></div><div class="spec type" id="type-parse_mode"><a href="#type-parse_mode" class="anchor"></a><div class="def type"><code><span class="keyword">type </span>parse_mode</code><code></code><code><span class="keyword"> = </span></code><table class="variant"><tr id="type-parse_mode.InferCommand" class="anchored"><td class="def constructor"><a href="#type-parse_mode.InferCommand" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">InferCommand</span></code></td><td class="doc"><p>(** parse arguments as arguments for infer *)</p></td></tr><tr id="type-parse_mode.Javac" class="anchored"><td class="def constructor"><a href="#type-parse_mode.Javac" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">Javac</span></code></td><td class="doc"><p>(** parse arguments passed to the Java compiler *)</p></td></tr><tr id="type-parse_mode.NoParse" class="anchored"><td class="def constructor"><a href="#type-parse_mode.NoParse" class="anchor"></a><code><span class="keyword">| </span></code><code><span class="constructor">NoParse</span></code></td><td class="doc"><p>(** all arguments are anonymous arguments, no parsing is attempted *)</p></td></tr></table><code></code></div><div class="doc"></div></div><div class="spec include"><div class="doc"></div><details open="open"><summary><span class="def"><code><span class="keyword">include </span><span class="keyword">sig</span> ... <span class="keyword">end</span></code></span></summary><div class="spec val" id="val-compare_parse_mode"><a href="#val-compare_parse_mode" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>compare_parse_mode : <a href="index.html#type-parse_mode">parse_mode</a> <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-parse_mode">parse_mode</a> <span class="keyword">&#8209;&gt;</span> int</code></div><div class="doc"></div></div></details></div><div class="spec val" id="val-is_originator"><a href="#val-is_originator" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>is_originator : bool</code></div><div class="doc"></div></div><div class="spec val" id="val-init_work_dir"><a href="#val-init_work_dir" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>init_work_dir : string</code></div><div class="doc"></div></div><div class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><div class="def type"><code><span class="keyword">type </span>'a t</code><code><span class="keyword"> = </span>?&#8288;deprecated:string list <span class="keyword">&#8209;&gt;</span> long:string <span class="keyword">&#8209;&gt;</span> ?&#8288;short:char <span class="keyword">&#8209;&gt;</span> ?&#8288;parse_mode:<a href="index.html#type-parse_mode">parse_mode</a> <span class="keyword">&#8209;&gt;</span> ?&#8288;in_help:(<a href="../../InferGenerated/InferGenerated/InferCommand/index.html#type-t">InferGenerated.InferCommand.t</a><span class="keyword"> * </span>string) list <span class="keyword">&#8209;&gt;</span> ?&#8288;meta:string <span class="keyword">&#8209;&gt;</span> string <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span></code><code></code></div><div class="doc"><p>The <code class="code">mk_*</code> functions declare command line options, while <code class="code">parse</code> parses then according to the
declared options.</p><p>The arguments of the declaration functions are largely treated uniformly:
</p><ul><li><code class="code">long</code> declares the option <code class="code">--long</code></li><li><code class="code">short</code> declares the option <code class="code">-short</code> as an alias</li><li><code class="code">deprecated</code> declares the option <code class="code">-key</code> as an alias, for each <code class="code">key</code> in <code class="code">deprecated</code></li><li><code class="code">default</code> specifies the default value</li><li><code class="code">default_to_string</code> is used to document the default value</li><li><code class="code">f</code> specifies a transformation to be performed on the parsed value before setting the config
variable</li><li><code class="code">symbols</code> is an association list sometimes used in place of <code class="code">f</code></li><li><code class="code">parse_mode</code> declares which parse mode the option is for</li><li><code class="code">in_help</code> indicates the man pages in which the command should be documented, as generated by
calling infer with --help. Otherwise it appears only in --help-full.</li><li><code class="code">meta</code> is a meta-variable naming the parsed value for documentation purposes</li><li>a documentation string</li></ul></div></div><div class="spec val" id="val-mk_set"><a href="#val-mk_set" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>mk_set : <span class="type-var">'a</span> <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.ref <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span> <span class="keyword">&#8209;&gt;</span> unit <a href="index.html#type-t">t</a></code></div><div class="doc"><p><code class="code">mk_set variable value</code> defines a command line option which sets <code class="code">variable</code> to <code class="code">value</code>.</p></div></div><div class="spec val" id="val-mk_bool"><a href="#val-mk_bool" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>mk_bool : ?&#8288;deprecated_no:string list <span class="keyword">&#8209;&gt;</span> ?&#8288;default:bool <span class="keyword">&#8209;&gt;</span> ?&#8288;f:(bool <span class="keyword">&#8209;&gt;</span> bool) <span class="keyword">&#8209;&gt;</span> bool <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.ref <a href="index.html#type-t">t</a></code></div><div class="doc"><p><code class="code">mk_bool long short doc</code> defines a <code class="code">bool ref</code> set by the command line flag <code class="code">--long</code> (and
<code class="code">-s</code>), and cleared by the flag <code class="code">--no-long</code> (and <code class="code">-S</code>). If <code class="code">long</code> already has a &quot;no-&quot; prefix,
or <code class="code">s</code> is capital, then the existing prefixes will instead be removed. The default
value is <code class="code">false</code> unless overridden by <code class="code">~default:true</code>. The <code class="code">doc</code> string will be prefixed with
either &quot;Activates:&quot; or &quot;Deactivates:&quot;, so should be phrased accordingly.</p></div></div><div class="spec val" id="val-mk_bool_group"><a href="#val-mk_bool_group" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>mk_bool_group : ?&#8288;deprecated_no:string list <span class="keyword">&#8209;&gt;</span> ?&#8288;default:bool <span class="keyword">&#8209;&gt;</span> ?&#8288;f:(bool <span class="keyword">&#8209;&gt;</span> bool) <span class="keyword">&#8209;&gt;</span> (bool <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.ref list <span class="keyword">&#8209;&gt;</span> bool <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.ref list <span class="keyword">&#8209;&gt;</span> bool <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.ref) <a href="index.html#type-t">t</a></code></div><div class="doc"><p><code class="code">mk_bool_group children not_children</code> behaves as <code class="code">mk_bool</code> with the addition that all the
<code class="code">children</code> are also set and the <code class="code">no_children</code> are unset. A child can be unset by including
&quot;--no-child&quot; later in the arguments.</p></div></div><div class="spec val" id="val-mk_int"><a href="#val-mk_int" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>mk_int : default:int <span class="keyword">&#8209;&gt;</span> ?&#8288;f:(int <span class="keyword">&#8209;&gt;</span> int) <span class="keyword">&#8209;&gt;</span> int <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.ref <a href="index.html#type-t">t</a></code></div><div class="doc"></div></div><div class="spec val" id="val-mk_int_opt"><a href="#val-mk_int_opt" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>mk_int_opt : ?&#8288;default:int <span class="keyword">&#8209;&gt;</span> ?&#8288;f:(int <span class="keyword">&#8209;&gt;</span> int) <span class="keyword">&#8209;&gt;</span> int option <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.ref <a href="index.html#type-t">t</a></code></div><div class="doc"></div></div><div class="spec val" id="val-mk_float_opt"><a href="#val-mk_float_opt" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>mk_float_opt : ?&#8288;default:float <span class="keyword">&#8209;&gt;</span> float option <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.ref <a href="index.html#type-t">t</a></code></div><div class="doc"></div></div><div class="spec val" id="val-mk_string"><a href="#val-mk_string" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>mk_string : default:string <span class="keyword">&#8209;&gt;</span> ?&#8288;f:(string <span class="keyword">&#8209;&gt;</span> string) <span class="keyword">&#8209;&gt;</span> string <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.ref <a href="index.html#type-t">t</a></code></div><div class="doc"></div></div><div class="spec val" id="val-mk_string_opt"><a href="#val-mk_string_opt" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>mk_string_opt : ?&#8288;default:string <span class="keyword">&#8209;&gt;</span> ?&#8288;f:(string <span class="keyword">&#8209;&gt;</span> string) <span class="keyword">&#8209;&gt;</span> ?&#8288;mk_reset:bool <span class="keyword">&#8209;&gt;</span> string option <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.ref <a href="index.html#type-t">t</a></code></div><div class="doc"><p>An option &quot;--<code class="code">long</code>-reset&quot; is automatically created that resets the reference to None when found
on the command line, unless <code class="code">mk_reset</code> is false.</p></div></div><div class="spec val" id="val-mk_string_list"><a href="#val-mk_string_list" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>mk_string_list : ?&#8288;default:string list <span class="keyword">&#8209;&gt;</span> ?&#8288;f:(string <span class="keyword">&#8209;&gt;</span> string) <span class="keyword">&#8209;&gt;</span> string list <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.ref <a href="index.html#type-t">t</a></code></div><div class="doc"><p><code class="code">mk_string_list</code> defines a <code class="code">string list ref</code>, initialized to <code class="code">[]</code> unless overridden by
<code class="code">~default</code>. Each argument of an occurrence of the option will be prepended to the list, so the
final value will be in the reverse order they appeared on the command line.</p><p>An option &quot;--<code class="code">long</code>-reset&quot; is automatically created that resets the list to <code class="code"></code> when found on the
command line.</p></div></div><div class="spec val" id="val-mk_path"><a href="#val-mk_path" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>mk_path : default:string <span class="keyword">&#8209;&gt;</span> ?&#8288;f:(string <span class="keyword">&#8209;&gt;</span> string) <span class="keyword">&#8209;&gt;</span> string <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.ref <a href="index.html#type-t">t</a></code></div><div class="doc"><p>like <code class="code">mk_string</code> but will resolve the string into an absolute path so that children processes
agree on the absolute path that the option represents</p></div></div><div class="spec val" id="val-mk_path_opt"><a href="#val-mk_path_opt" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>mk_path_opt : ?&#8288;default:string <span class="keyword">&#8209;&gt;</span> string option <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.ref <a href="index.html#type-t">t</a></code></div><div class="doc"><p>analogous of <code class="code">mk_string_opt</code> with the extra feature of <code class="code">mk_path</code></p></div></div><div class="spec val" id="val-mk_path_list"><a href="#val-mk_path_list" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>mk_path_list : ?&#8288;default:string list <span class="keyword">&#8209;&gt;</span> string list <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.ref <a href="index.html#type-t">t</a></code></div><div class="doc"><p>analogous of <code class="code">mk_string_list</code> with the extra feature of <code class="code">mk_path</code></p></div></div><div class="spec val" id="val-mk_symbol"><a href="#val-mk_symbol" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>mk_symbol : default:<span class="type-var">'a</span> <span class="keyword">&#8209;&gt;</span> symbols:(string<span class="keyword"> * </span><span class="type-var">'a</span>) list <span class="keyword">&#8209;&gt;</span> eq:(<span class="type-var">'a</span> <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span> <span class="keyword">&#8209;&gt;</span> bool) <span class="keyword">&#8209;&gt;</span> ?&#8288;f:(<span class="type-var">'a</span> <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span>) <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span> <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.ref <a href="index.html#type-t">t</a></code></div><div class="doc"><p><code class="code">mk_symbol long symbols</code> defines a command line flag <code class="code">--long &lt;symbol&gt;</code> where <code class="code">(&lt;symbol&gt;,_)</code> is
an element of <code class="code">symbols</code>.</p></div></div><div class="spec val" id="val-mk_symbol_opt"><a href="#val-mk_symbol_opt" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>mk_symbol_opt : symbols:(string<span class="keyword"> * </span><span class="type-var">'a</span>) list <span class="keyword">&#8209;&gt;</span> ?&#8288;f:(<span class="type-var">'a</span> <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span>) <span class="keyword">&#8209;&gt;</span> ?&#8288;mk_reset:bool <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span> option <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.ref <a href="index.html#type-t">t</a></code></div><div class="doc"><p><code class="code">mk_symbol_opt</code> is similar to <code class="code">mk_symbol</code> but defaults to <code class="code">None</code>. If <code class="code">mk_reset</code> is false then do not create an additional --<code class="code">long</code>-reset option to reset the value of the option to <code class="code">None</code>.</p></div></div><div class="spec val" id="val-mk_symbol_seq"><a href="#val-mk_symbol_seq" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>mk_symbol_seq : ?&#8288;default:<span class="type-var">'a</span> list <span class="keyword">&#8209;&gt;</span> symbols:(string<span class="keyword"> * </span><span class="type-var">'a</span>) list <span class="keyword">&#8209;&gt;</span> eq:(<span class="type-var">'a</span> <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span> <span class="keyword">&#8209;&gt;</span> bool) <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span> list <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.ref <a href="index.html#type-t">t</a></code></div><div class="doc"><p><code class="code">mk_symbol_seq long symbols</code> defines a command line flag <code class="code">--long &lt;symbol sequence&gt;</code> where
<code class="code">&lt;symbol sequence&gt;</code> is a comma-separated sequence of <code class="code">&lt;symbol&gt;</code>s such that <code class="code">(&lt;symbol&gt;,_)</code> is an
element of <code class="code">symbols</code>.</p></div></div><div class="spec val" id="val-mk_json"><a href="#val-mk_json" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>mk_json : Yojson.Basic.json <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.ref <a href="index.html#type-t">t</a></code></div><div class="doc"></div></div><div class="spec val" id="val-mk_anon"><a href="#val-mk_anon" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>mk_anon : unit <span class="keyword">&#8209;&gt;</span> string list <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.ref</code></div><div class="doc"><p><code class="code">mk_anon ()</code> defines a <code class="code">string list ref</code> of the anonymous command line arguments, in the reverse
order they appeared on the command line.</p></div></div><div class="spec val" id="val-mk_rest_actions"><a href="#val-mk_rest_actions" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>mk_rest_actions : ?&#8288;parse_mode:<a href="index.html#type-parse_mode">parse_mode</a> <span class="keyword">&#8209;&gt;</span> ?&#8288;in_help:(<a href="../../InferGenerated/InferGenerated/InferCommand/index.html#type-t">InferGenerated.InferCommand.t</a><span class="keyword"> * </span>string) list <span class="keyword">&#8209;&gt;</span> string <span class="keyword">&#8209;&gt;</span> usage:string <span class="keyword">&#8209;&gt;</span> (string <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-parse_mode">parse_mode</a>) <span class="keyword">&#8209;&gt;</span> string list <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.ref</code></div><div class="doc"><p><code class="code">mk_rest_actions doc ~usage command_to_parse_mode</code> defines a <code class="code">string list ref</code> of the command
line arguments following <code class="code">&quot;--&quot;</code>, in the reverse order they appeared on the command line. <code class="code">usage</code>
is the usage message in case of parse errors or if --help is passed. For example, calling
<code class="code">mk_action</code> and parsing <code class="code">exe -opt1 -opt2 -- arg1 arg2</code> will result in the returned ref
containing <code class="code">arg2; arg1</code>. Additionally, the first arg following <code class="code">&quot;--&quot;</code> is passed to
<code class="code">command_to_parse_mode</code> to obtain the parse action that will be used to parse the remaining
arguments.</p></div></div><div class="spec type" id="type-command_doc"><a href="#type-command_doc" class="anchor"></a><div class="def type"><code><span class="keyword">type </span>command_doc</code><code></code><code></code></div><div class="doc"></div></div><div class="spec val" id="val-mk_command_doc"><a href="#val-mk_command_doc" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>mk_command_doc : title:string <span class="keyword">&#8209;&gt;</span> section:int <span class="keyword">&#8209;&gt;</span> version:string <span class="keyword">&#8209;&gt;</span> date:string <span class="keyword">&#8209;&gt;</span> short_description:string <span class="keyword">&#8209;&gt;</span> synopsis:Cmdliner.Manpage.block list <span class="keyword">&#8209;&gt;</span> description:Cmdliner.Manpage.block list <span class="keyword">&#8209;&gt;</span> ?&#8288;options:[ `Prepend of Cmdliner.Manpage.block list | `Replace of Cmdliner.Manpage.block list ] <span class="keyword">&#8209;&gt;</span> ?&#8288;exit_status:Cmdliner.Manpage.block list <span class="keyword">&#8209;&gt;</span> ?&#8288;environment:Cmdliner.Manpage.block list <span class="keyword">&#8209;&gt;</span> ?&#8288;files:Cmdliner.Manpage.block list <span class="keyword">&#8209;&gt;</span> ?&#8288;notes:Cmdliner.Manpage.block list <span class="keyword">&#8209;&gt;</span> ?&#8288;bugs:Cmdliner.Manpage.block list <span class="keyword">&#8209;&gt;</span> ?&#8288;examples:Cmdliner.Manpage.block list <span class="keyword">&#8209;&gt;</span> see_also:Cmdliner.Manpage.block list <span class="keyword">&#8209;&gt;</span> string <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-command_doc">command_doc</a></code></div><div class="doc"><p><code class="code">mk_command_doc ~title ~section ~version ~short_description ~synopsis ~description ~see_also
command_exe</code> records information about a command that is used to create its man page. A lot of
the concepts are taken from man-pages(7).</p><ul><li><code class="code">command_exe</code> is the name of the command, preferably an executable that selects the command</li><li><code class="code">title</code> will be the title of the manual</li><li><code class="code">section</code> will be the section of the manual (the number 7 in man-pages(7))</li><li><code class="code">version</code> is the version string of the command</li><li><code class="code">date</code> is the date of the last modification of the manual</li><li><code class="code">short_description</code> is a one-line description of the command</li><li><code class="code">options</code> can be either <code class="code">`Replace blocks</code>, which populates the OPTIONS section with <code class="code">blocks</code>,
or <code class="code">`Prepend blocks</code>, in which case the options from the command are used, prepended by
<code class="code">blocks</code>. If unspecified it defaults to <code class="code">`Prepend []</code>.</li><li>All the other <code class="code">section_name</code> options correspond to the contents of the section <code class="code">section_name</code>.
Some are mandatory and some are not.</li></ul></div></div><div class="spec val" id="val-mk_subcommand"><a href="#val-mk_subcommand" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>mk_subcommand : <a href="../../InferGenerated/InferGenerated/InferCommand/index.html#type-t">InferGenerated.InferCommand.t</a> <span class="keyword">&#8209;&gt;</span> ?&#8288;on_unknown_arg:[ `Add | `Skip | `Reject ] <span class="keyword">&#8209;&gt;</span> name:string <span class="keyword">&#8209;&gt;</span> ?&#8288;deprecated_long:string <span class="keyword">&#8209;&gt;</span> ?&#8288;parse_mode:<a href="index.html#type-parse_mode">parse_mode</a> <span class="keyword">&#8209;&gt;</span> ?&#8288;in_help:(<a href="../../InferGenerated/InferGenerated/InferCommand/index.html#type-t">InferGenerated.InferCommand.t</a><span class="keyword"> * </span>string) list <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-command_doc">command_doc</a> option <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p><code class="code">mk_subcommand command ~long command_doc</code> defines the subcommand <code class="code">command</code>. A subcommand is
activated by passing <code class="code">name</code>, and by passing <code class="code">--deprecated_long</code> if specified. A man page is
automatically generated for <code class="code">command</code> based on the information in <code class="code">command_doc</code>, if available
(otherwise the command is considered internal). <code class="code">on_unknown_arg</code> is the action taken on unknown
anonymous arguments; it is `Reject by default.</p></div></div><div class="spec val" id="val-args_env_var"><a href="#val-args_env_var" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>args_env_var : string</code></div><div class="doc"><p>environment variable use to pass arguments from parent to child processes</p></div></div><div class="spec val" id="val-strict_mode_env_var"><a href="#val-strict_mode_env_var" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>strict_mode_env_var : string</code></div><div class="doc"></div></div><div class="spec val" id="val-env_var_sep"><a href="#val-env_var_sep" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>env_var_sep : char</code></div><div class="doc"><p>separator of argv elements when encoded into environment variables</p></div></div><div class="spec val" id="val-extend_env_args"><a href="#val-extend_env_args" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>extend_env_args : string list <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p><code class="code">extend_env_args args</code> appends <code class="code">args</code> to those passed via <code class="code">args_env_var</code></p></div></div><div class="spec val" id="val-parse"><a href="#val-parse" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>parse : ?&#8288;config_file:string <span class="keyword">&#8209;&gt;</span> usage:<a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.Arg.usage_msg <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-parse_mode">parse_mode</a> <span class="keyword">&#8209;&gt;</span> <a href="../../InferGenerated/InferGenerated/InferCommand/index.html#type-t">InferGenerated.InferCommand.t</a> option <span class="keyword">&#8209;&gt;</span> <a href="../../InferGenerated/InferGenerated/InferCommand/index.html#type-t">InferGenerated.InferCommand.t</a> option<span class="keyword"> * </span>(int <span class="keyword">&#8209;&gt;</span> <span class="type-var">'a</span>)</code></div><div class="doc"><p><code class="code">parse ~usage parse_mode command</code> parses command line arguments as specified by preceding calls
to the <code class="code">mk_*</code> functions, and returns:
</p><ul><li>the command selected by the user on the command line, except if <code class="code">command</code> is not None in which
case it is considered &quot;pre-selected&quot; for the user;</li><li>a function that prints the usage message and help text then exits with the code passed as
argument.</li></ul><p>The decoded values of the inferconfig file <code class="code">config_file</code>, if provided, are parsed, followed by
the decoded values of the environment variable <code class="code">args_env_var</code>, followed by <code class="code">Sys.argv</code> if
<code class="code">parse_mode</code> is one that should parse command line arguments (this is defined in the
implementation of this module). Therefore arguments passed on the command line supersede those
specified in the environment variable, which themselves supersede those passed via the config
file.</p><p>WARNING: An argument will be interpreted as many times as it appears in all of the config file,
the environment variable, and the command line. The <code class="code">args_env_var</code> is set to the set of options
parsed in <code class="code">args_env_var</code> and on the command line.</p></div></div><div class="spec val" id="val-is_env_var_set"><a href="#val-is_env_var_set" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>is_env_var_set : string <span class="keyword">&#8209;&gt;</span> bool</code></div><div class="doc"><p><code class="code">is_env_var_set var</code> is true if $<code class="code">var</code>=1</p></div></div><div class="spec val" id="val-show_manual"><a href="#val-show_manual" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>show_manual : ?&#8288;internal_section:string <span class="keyword">&#8209;&gt;</span> Cmdliner.Manpage.format <span class="keyword">&#8209;&gt;</span> <a href="index.html#type-command_doc">command_doc</a> <span class="keyword">&#8209;&gt;</span> <a href="../../InferGenerated/InferGenerated/InferCommand/index.html#type-t">InferGenerated.InferCommand.t</a> option <span class="keyword">&#8209;&gt;</span> unit</code></div><div class="doc"><p>Display the manual of <code class="code">command</code> to the user, or <code class="code">command_doc</code> if <code class="code">command</code> is None. <code class="code">format</code> is
used as for <code class="code">Cmdliner.Manpage.print</code>. If <code class="code">internal_section</code> is specified, add a section titled
<code class="code">internal_section</code> about internal (hidden) options.</p></div></div><div class="spec val" id="val-keep_args_file"><a href="#val-keep_args_file" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>keep_args_file : bool <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.ref</code></div><div class="doc"></div></div></body></html>