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.

3 lines
28 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.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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