<htmlxmlns="http://www.w3.org/1999/xhtml"><head><title>IBase__CommandLineOption (infer.IBase__CommandLineOption)</title><linkrel="stylesheet"href="../../odoc.css"/><metacharset="utf-8"/><metaname="generator"content="odoc 1.5.0"/><metaname="viewport"content="width=device-width,initial-scale=1.0"/><scriptsrc="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><divclass="content"><header><nav><ahref="../index.html">Up</a>–<ahref="../index.html">infer</a>» IBase__CommandLineOption</nav><h1>Module <code>IBase__CommandLineOption</code></h1><p>Definition and parsing of command line arguments</p></header><dl><dtclass="spec value"id="val-warnf"><ahref="#val-warnf"class="anchor"></a><code><spanclass="keyword">val</span> warnf : <span><span>(<spanclass="type-var">'a</span>,Stdlib.Format.formatter,unit)</span><ahref="../IStdlib/index.html#module-IStd">IStdlib.IStd</a>.format</span><span>-></span><spanclass="type-var">'a</span></code></dt><dd><p>Print to stderr in case of error, fails in strict mode</p></dd></dl><dl><dtclass="spec type"id="type-parse_mode"><ahref="#type-parse_mode"class="anchor"></a><code><spanclass="keyword">type</span> parse_mode</code><code> = </code><tableclass="variant"><trid="type-parse_mode.InferCommand"class="anchored"><tdclass="def constructor"><ahref="#type-parse_mode.InferCommand"class="anchor"></a><code>| </code><code><spanclass="constructor">InferCommand</span></code></td><tdclass="doc"><p>parse arguments as arguments for infer</p></td></tr><trid="type-parse_mode.Javac"class="anchored"><tdclass="def constructor"><ahref="#type-parse_mode.Javac"class="anchor"></a><code>| </code><code><spanclass="constructor">Javac</span></code></td><tdclass="doc"><p>parse arguments passed to the Java compiler</p></td></tr><trid="type-parse_mode.NoParse"class="anchored"><tdclass="def constructor"><ahref="#type-parse_mode.NoParse"class="anchor"></a><code>| </code><code><spanclass="constructor">NoParse</span></code></td><tdclass="doc"><p>all arguments are anonymous arguments, no parsing is attempted</p></td></tr></table></dt></dl><div><divclass="spec include"><divclass="doc"><dl><dtclass="spec value"id="val-compare_parse_mode"><ahref="#val-compare_parse_mode"class="anchor"></a><code><spanclass="keyword">val</span> compare_parse_mode : <ahref="index.html#type-parse_mode">parse_mode</a><span>-></span><ahref="index.html#type-parse_mode">parse_mode</a><span>-></span> int</code></dt></dl></div></div></div><dl><dtclass="spec value"id="val-is_originator"><ahref="#val-is_originator"class="anchor"></a><code><spanclass="keyword">val</span> is_originator : bool</code></dt><dtclass="spec value"id="val-init_work_dir"><ahref="#val-init_work_dir"class="anchor"></a><code><spanclass="keyword">val</span> init_work_dir : string</code></dt></dl><dl><dtclass="spec type"id="type-t"><ahref="#type-t"class="anchor"></a><code><spanclass="keyword">type</span><span>'a t</span></code><code> = <span>?⁠deprecated:<span>string list</span></span><span>-></span><span>long:string</span><span>-></span><span>?⁠short:char</span><span>-></span><span>?⁠parse_mode:<ahref="index.html#type-parse_mode">parse_mode</a></span><span>-></span><span>?⁠in_help:<span><span>(<ahref="../ATDGenerated/InferCommand/index.html#type-t">ATDGenerated.InferCommand.t</a> * string)</span> list</span></span><span>-></span><span>?⁠meta:string</span><span>-></span> string <span>-></span><spanclass="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 <
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><dtclass="spec value"id="val-mk_subcommand"><ahref="#val-mk_subcommand"class="anchor"></a><code><spanclass="keyword">val</span> mk_subcommand : <ahref="../ATDGenerated/InferCommand/index.html#type-t">ATDGenerated.InferCommand.t</a><span>-></span><span>?⁠on_unknown_arg:<span>[ `Add <span>| `Skip</span><span>| `Reject</span> ]</span></span><span>-></span><span>name:string</span><span>-></span><span>?⁠deprecated_long:string</span><span>-></span><span>?⁠parse_mode:<ahref="index.html#type-parse_mode">parse_mode</a></span><span>-></span><span>?⁠in_help:<span><span>(<ahref="../ATDGenerated/InferCommand/index.html#type-t">ATDGenerated.InferCommand.t</a> * string)</span> list</span></span><span>-></span><span><ahref="index.html#type-command_doc">command_doc</a> option</span><span>-></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><dtclass="spec value"id="val-args_env_var"><ahref="#val-args_env_var"class="anchor"></a><code><spanclass="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><dtclass="spec value"id="val-strict_mode"><ahref="#val-strict_mode"class="anchor"></a><code><spanclass="keyword">val</span> strict_mode : bool</code></dt><dtclass="spec value"id="val-strict_mode_env_var"><ahref="#val-strict_mode_env_var"class="anchor"></a><code><spanclass="keyword">val</span> strict_mode_env_var : string</code></dt><dtclass="spec value"id="val-env_var_sep"><ahref="#val-env_var_sep"class="anchor"></a><code><spanclass="keyword">val</span> env_var_sep : char</code></dt><dd><p>separator of argv elements when encoded into environment variables</p></dd></dl><dl><dtclass="spec value"id="val-extend_env_args"><ahref="#val-extend_env_args"class="anchor"></a><code><spanclass="keyword">val</span> extend_env_args : <span>string list</span><span>-></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><dtclass="spec value"id="val-parse"><ahref="#val-parse"class="anchor"></a><code><spanclass="keyword">val</span> parse : <span>?⁠config_file:string</span><span>-></span><span>usage:<ahref="../IStdlib/index.html#module-IStd">IStdlib.IStd</a>.Arg.usage_msg</span><span>-></span><ahref="index.html#type-p