blob: fd3767c491b7629fa62f09de72aa424c1b763361 [file] [log] [blame]
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Application level settings, which affect how `App` operates"><meta name="keywords" content="rust, rustlang, rust-lang, AppSettings"><title>AppSettings in clap - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../normalize.css"><link rel="stylesheet" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../ayu.css" disabled><link rel="stylesheet" href="../dark.css" disabled><link rel="stylesheet" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc enum"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../clap/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../clap/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">AppSettings</a></h2><div class="sidebar-elems"><section><h3><a href="#variants">Variants</a></h3><ul class="block"><li><a href="#variant.AllArgsOverrideSelf">AllArgsOverrideSelf</a></li><li><a href="#variant.AllowExternalSubcommands">AllowExternalSubcommands</a></li><li><a href="#variant.AllowInvalidUtf8">AllowInvalidUtf8</a></li><li><a href="#variant.AllowLeadingHyphen">AllowLeadingHyphen</a></li><li><a href="#variant.AllowMissingPositional">AllowMissingPositional</a></li><li><a href="#variant.AllowNegativeNumbers">AllowNegativeNumbers</a></li><li><a href="#variant.ArgRequiredElseHelp">ArgRequiredElseHelp</a></li><li><a href="#variant.ArgsNegateSubcommands">ArgsNegateSubcommands</a></li><li><a href="#variant.ColorAlways">ColorAlways</a></li><li><a href="#variant.ColorAuto">ColorAuto</a></li><li><a href="#variant.ColorNever">ColorNever</a></li><li><a href="#variant.ColoredHelp">ColoredHelp</a></li><li><a href="#variant.DeriveDisplayOrder">DeriveDisplayOrder</a></li><li><a href="#variant.DisableHelpFlags">DisableHelpFlags</a></li><li><a href="#variant.DisableHelpSubcommand">DisableHelpSubcommand</a></li><li><a href="#variant.DisableVersion">DisableVersion</a></li><li><a href="#variant.DontCollapseArgsInUsage">DontCollapseArgsInUsage</a></li><li><a href="#variant.DontDelimitTrailingValues">DontDelimitTrailingValues</a></li><li><a href="#variant.GlobalVersion">GlobalVersion</a></li><li><a href="#variant.Hidden">Hidden</a></li><li><a href="#variant.HidePossibleValuesInHelp">HidePossibleValuesInHelp</a></li><li><a href="#variant.InferSubcommands">InferSubcommands</a></li><li><a href="#variant.NextLineHelp">NextLineHelp</a></li><li><a href="#variant.NoBinaryName">NoBinaryName</a></li><li><a href="#variant.PropagateGlobalValuesDown">PropagateGlobalValuesDown</a></li><li><a href="#variant.StrictUtf8">StrictUtf8</a></li><li><a href="#variant.SubcommandRequired">SubcommandRequired</a></li><li><a href="#variant.SubcommandRequiredElseHelp">SubcommandRequiredElseHelp</a></li><li><a href="#variant.SubcommandsNegateReqs">SubcommandsNegateReqs</a></li><li><a href="#variant.TrailingVarArg">TrailingVarArg</a></li><li><a href="#variant.UnifiedHelpMessage">UnifiedHelpMessage</a></li><li><a href="#variant.VersionlessSubcommands">VersionlessSubcommands</a></li><li><a href="#variant.WaitOnError">WaitOnError</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block"><li><a href="#impl-Clone-for-AppSettings">Clone</a></li><li><a href="#impl-Copy-for-AppSettings">Copy</a></li><li><a href="#impl-Debug-for-AppSettings">Debug</a></li><li><a href="#impl-FromStr-for-AppSettings">FromStr</a></li><li><a href="#impl-PartialEq%3CAppSettings%3E-for-AppSettings">PartialEq&lt;AppSettings&gt;</a></li><li><a href="#impl-StructuralPartialEq-for-AppSettings">StructuralPartialEq</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block"><li><a href="#impl-RefUnwindSafe-for-AppSettings">RefUnwindSafe</a></li><li><a href="#impl-Send-for-AppSettings">Send</a></li><li><a href="#impl-Sync-for-AppSettings">Sync</a></li><li><a href="#impl-Unpin-for-AppSettings">Unpin</a></li><li><a href="#impl-UnwindSafe-for-AppSettings">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block"><li><a href="#impl-Any-for-AppSettings">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-AppSettings">Borrow&lt;T&gt;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-AppSettings">BorrowMut&lt;T&gt;</a></li><li><a href="#impl-From%3CT%3E-for-AppSettings">From&lt;T&gt;</a></li><li><a href="#impl-Into%3CU%3E-for-AppSettings">Into&lt;U&gt;</a></li><li><a href="#impl-ToOwned-for-AppSettings">ToOwned</a></li><li><a href="#impl-TryFrom%3CU%3E-for-AppSettings">TryFrom&lt;U&gt;</a></li><li><a href="#impl-TryInto%3CU%3E-for-AppSettings">TryInto&lt;U&gt;</a></li></ul></section><h2><a href="index.html">In clap</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Enum <a href="index.html">clap</a>::<wbr><a class="enum" href="#">AppSettings</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../src/clap/app/settings.rs.html#139-998">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="item-decl"><pre class="rust enum"><code>pub enum AppSettings {
<details class="rustdoc-toggle type-contents-toggle"><summary class="hideme"><span>Show 33 variants</span></summary> AllowInvalidUtf8,
AllArgsOverrideSelf,
AllowLeadingHyphen,
AllowNegativeNumbers,
AllowMissingPositional,
AllowExternalSubcommands,
ArgsNegateSubcommands,
ArgRequiredElseHelp,
ColoredHelp,
ColorAuto,
ColorAlways,
ColorNever,
DontCollapseArgsInUsage,
DontDelimitTrailingValues,
DisableHelpFlags,
DisableHelpSubcommand,
DisableVersion,
DeriveDisplayOrder,
GlobalVersion,
Hidden,
HidePossibleValuesInHelp,
InferSubcommands,
NoBinaryName,
NextLineHelp,
PropagateGlobalValuesDown,
SubcommandsNegateReqs,
SubcommandRequiredElseHelp,
StrictUtf8,
SubcommandRequired,
TrailingVarArg,
UnifiedHelpMessage,
VersionlessSubcommands,
WaitOnError,
// some variants omitted
</details>}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Application level settings, which affect how <a href="./struct.App.html"><code>App</code></a> operates</p>
<p><strong>NOTE:</strong> When these settings are used, they apply only to current command, and are <em>not</em>
propagated down or up through child or parent subcommands</p>
</div></details><h2 id="variants" class="variants small-section-header">Variants<a href="#variants" class="anchor"></a></h2><h3 id="variant.AllowInvalidUtf8" class="variant small-section-header"><a href="#variant.AllowInvalidUtf8" class="anchor field"></a><code>AllowInvalidUtf8</code></h3><div class="docblock"><p>Specifies that any invalid UTF-8 code points should <em>not</em> be treated as an error.
This is the default behavior of <code>clap</code>.</p>
<p><strong>NOTE:</strong> Using argument values with invalid UTF-8 code points requires using
<a href="./struct.ArgMatches.html#method.os_value_of"><code>ArgMatches::os_value_of</code></a>, <a href="./struct.ArgMatches.html#method.os_values_of"><code>ArgMatches::os_values_of</code></a>, <a href="./struct.ArgMatches.html#method.lossy_value_of"><code>ArgMatches::lossy_value_of</code></a>,
or <a href="./struct.ArgMatches.html#method.lossy_values_of"><code>ArgMatches::lossy_values_of</code></a> for those particular arguments which may contain invalid
UTF-8 values</p>
<p><strong>NOTE:</strong> This rule only applies to argument values, as flags, options, and
<a href="./struct.SubCommand.html"><code>SubCommand</code></a>s themselves only allow valid UTF-8 code points.</p>
<h4 id="platform-specific"><a href="#platform-specific">Platform Specific</a></h4>
<p>Non Windows systems only</p>
<h4 id="examples"><a href="#examples">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::ffi::OsString;
<span class="kw">use </span>std::os::unix::ffi::{OsStrExt,OsStringExt};
<span class="kw">let </span>r = App::new(<span class="string">&quot;myprog&quot;</span>)
<span class="comment">//.setting(AppSettings::AllowInvalidUtf8)
</span>.arg_from_usage(<span class="string">&quot;&lt;arg&gt; &#39;some positional arg&#39;&quot;</span>)
.get_matches_from_safe(
<span class="macro">vec!</span>[
OsString::from(<span class="string">&quot;myprog&quot;</span>),
OsString::from_vec(<span class="macro">vec!</span>[<span class="number">0xe9</span>])]);
<span class="macro">assert!</span>(r.is_ok());
<span class="kw">let </span>m = r.unwrap();
<span class="macro">assert_eq!</span>(m.value_of_os(<span class="string">&quot;arg&quot;</span>).unwrap().as_bytes(), <span class="kw-2">&amp;</span>[<span class="number">0xe9</span>]);</code></pre></div>
</div><h3 id="variant.AllArgsOverrideSelf" class="variant small-section-header"><a href="#variant.AllArgsOverrideSelf" class="anchor field"></a><code>AllArgsOverrideSelf</code></h3><div class="docblock"><p>Essentially sets [<code>Arg::overrides_with(&quot;itself&quot;)</code>] for all arguments.</p>
<p><strong>WARNING:</strong> Positional arguments cannot override themselves (or we would never be able
to advance to the next positional). This setting ignores positional arguments.
[<code>Arg::overrides_with(&quot;itself&quot;)</code>]: ./struct.Arg.html#method.overrides_with</p>
</div><h3 id="variant.AllowLeadingHyphen" class="variant small-section-header"><a href="#variant.AllowLeadingHyphen" class="anchor field"></a><code>AllowLeadingHyphen</code></h3><div class="docblock"><p>Specifies that leading hyphens are allowed in argument <em>values</em>, such as negative numbers
like <code>-10</code>. (which would otherwise be parsed as another flag or option)</p>
<p><strong>NOTE:</strong> Use this setting with caution as it silences certain circumstances which would
otherwise be an error (such as accidentally forgetting to specify a value for leading
option). It is preferred to set this on a per argument basis, via <a href="./struct.Arg.html#method.allow_hyphen_values"><code>Arg::allow_hyphen_values</code></a></p>
<h4 id="examples-1"><a href="#examples-1">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// Imagine you needed to represent negative numbers as well, such as -10
</span><span class="kw">let </span>m = App::new(<span class="string">&quot;nums&quot;</span>)
.setting(AppSettings::AllowLeadingHyphen)
.arg(Arg::with_name(<span class="string">&quot;neg&quot;</span>).index(<span class="number">1</span>))
.get_matches_from(<span class="macro">vec!</span>[
<span class="string">&quot;nums&quot;</span>, <span class="string">&quot;-20&quot;
</span>]);
<span class="macro">assert_eq!</span>(m.value_of(<span class="string">&quot;neg&quot;</span>), <span class="prelude-val">Some</span>(<span class="string">&quot;-20&quot;</span>));</code></pre></div>
</div><h3 id="variant.AllowNegativeNumbers" class="variant small-section-header"><a href="#variant.AllowNegativeNumbers" class="anchor field"></a><code>AllowNegativeNumbers</code></h3><div class="docblock"><p>Allows negative numbers to pass as values. This is similar to
<code>AllowLeadingHyphen</code> except that it only allows numbers, all
other undefined leading hyphens will fail to parse.</p>
<h4 id="examples-2"><a href="#examples-2">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>res = App::new(<span class="string">&quot;myprog&quot;</span>)
.version(<span class="string">&quot;v1.1&quot;</span>)
.setting(AppSettings::AllowNegativeNumbers)
.arg(Arg::with_name(<span class="string">&quot;num&quot;</span>))
.get_matches_from_safe(<span class="macro">vec!</span>[
<span class="string">&quot;myprog&quot;</span>, <span class="string">&quot;-20&quot;
</span>]);
<span class="macro">assert!</span>(res.is_ok());
<span class="kw">let </span>m = res.unwrap();
<span class="macro">assert_eq!</span>(m.value_of(<span class="string">&quot;num&quot;</span>).unwrap(), <span class="string">&quot;-20&quot;</span>);</code></pre></div>
</div><h3 id="variant.AllowMissingPositional" class="variant small-section-header"><a href="#variant.AllowMissingPositional" class="anchor field"></a><code>AllowMissingPositional</code></h3><div class="docblock"><p>Allows one to implement two styles of CLIs where positionals can be used out of order.</p>
<p>The first example is a CLI where the second to last positional argument is optional, but
the final positional argument is required. Such as <code>$ prog [optional] &lt;required&gt;</code> where one
of the two following usages is allowed:</p>
<ul>
<li><code>$ prog [optional] &lt;required&gt;</code></li>
<li><code>$ prog &lt;required&gt;</code></li>
</ul>
<p>This would otherwise not be allowed. This is useful when <code>[optional]</code> has a default value.</p>
<p><strong>Note:</strong> when using this style of “missing positionals” the final positional <em>must</em> be
<a href="./struct.Arg.html#method.required">required</a> if <code>--</code> will not be used to skip to the final positional argument.</p>
<p><strong>Note:</strong> This style also only allows a single positional argument to be “skipped” without
the use of <code>--</code>. To skip more than one, see the second example.</p>
<p>The second example is when one wants to skip multiple optional positional arguments, and use
of the <code>--</code> operator is OK (but not required if all arguments will be specified anyways).</p>
<p>For example, imagine a CLI which has three positional arguments <code>[foo] [bar] [baz]...</code> where
<code>baz</code> accepts multiple values (similar to man <code>ARGS...</code> style training arguments).</p>
<p>With this setting the following invocations are possible:</p>
<ul>
<li><code>$ prog foo bar baz1 baz2 baz3</code></li>
<li><code>$ prog foo -- baz1 baz2 baz3</code></li>
<li><code>$ prog -- baz1 baz2 baz3</code></li>
</ul>
<h4 id="examples-3"><a href="#examples-3">Examples</a></h4>
<p>Style number one from above:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// Assume there is an external subcommand named &quot;subcmd&quot;
</span><span class="kw">let </span>m = App::new(<span class="string">&quot;myprog&quot;</span>)
.setting(AppSettings::AllowMissingPositional)
.arg(Arg::with_name(<span class="string">&quot;arg1&quot;</span>))
.arg(Arg::with_name(<span class="string">&quot;arg2&quot;</span>)
.required(<span class="bool-val">true</span>))
.get_matches_from(<span class="macro">vec!</span>[
<span class="string">&quot;prog&quot;</span>, <span class="string">&quot;other&quot;
</span>]);
<span class="macro">assert_eq!</span>(m.value_of(<span class="string">&quot;arg1&quot;</span>), <span class="prelude-val">None</span>);
<span class="macro">assert_eq!</span>(m.value_of(<span class="string">&quot;arg2&quot;</span>), <span class="prelude-val">Some</span>(<span class="string">&quot;other&quot;</span>));</code></pre></div>
<p>Now the same example, but using a default value for the first optional positional argument</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// Assume there is an external subcommand named &quot;subcmd&quot;
</span><span class="kw">let </span>m = App::new(<span class="string">&quot;myprog&quot;</span>)
.setting(AppSettings::AllowMissingPositional)
.arg(Arg::with_name(<span class="string">&quot;arg1&quot;</span>)
.default_value(<span class="string">&quot;something&quot;</span>))
.arg(Arg::with_name(<span class="string">&quot;arg2&quot;</span>)
.required(<span class="bool-val">true</span>))
.get_matches_from(<span class="macro">vec!</span>[
<span class="string">&quot;prog&quot;</span>, <span class="string">&quot;other&quot;
</span>]);
<span class="macro">assert_eq!</span>(m.value_of(<span class="string">&quot;arg1&quot;</span>), <span class="prelude-val">Some</span>(<span class="string">&quot;something&quot;</span>));
<span class="macro">assert_eq!</span>(m.value_of(<span class="string">&quot;arg2&quot;</span>), <span class="prelude-val">Some</span>(<span class="string">&quot;other&quot;</span>));</code></pre></div>
<p>Style number two from above:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// Assume there is an external subcommand named &quot;subcmd&quot;
</span><span class="kw">let </span>m = App::new(<span class="string">&quot;myprog&quot;</span>)
.setting(AppSettings::AllowMissingPositional)
.arg(Arg::with_name(<span class="string">&quot;foo&quot;</span>))
.arg(Arg::with_name(<span class="string">&quot;bar&quot;</span>))
.arg(Arg::with_name(<span class="string">&quot;baz&quot;</span>).multiple(<span class="bool-val">true</span>))
.get_matches_from(<span class="macro">vec!</span>[
<span class="string">&quot;prog&quot;</span>, <span class="string">&quot;foo&quot;</span>, <span class="string">&quot;bar&quot;</span>, <span class="string">&quot;baz1&quot;</span>, <span class="string">&quot;baz2&quot;</span>, <span class="string">&quot;baz3&quot;
</span>]);
<span class="macro">assert_eq!</span>(m.value_of(<span class="string">&quot;foo&quot;</span>), <span class="prelude-val">Some</span>(<span class="string">&quot;foo&quot;</span>));
<span class="macro">assert_eq!</span>(m.value_of(<span class="string">&quot;bar&quot;</span>), <span class="prelude-val">Some</span>(<span class="string">&quot;bar&quot;</span>));
<span class="macro">assert_eq!</span>(m.values_of(<span class="string">&quot;baz&quot;</span>).unwrap().collect::&lt;Vec&lt;<span class="kw">_</span>&gt;&gt;(), <span class="kw-2">&amp;</span>[<span class="string">&quot;baz1&quot;</span>, <span class="string">&quot;baz2&quot;</span>, <span class="string">&quot;baz3&quot;</span>]);</code></pre></div>
<p>Now notice if we don’t specify <code>foo</code> or <code>baz</code> but use the <code>--</code> operator.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// Assume there is an external subcommand named &quot;subcmd&quot;
</span><span class="kw">let </span>m = App::new(<span class="string">&quot;myprog&quot;</span>)
.setting(AppSettings::AllowMissingPositional)
.arg(Arg::with_name(<span class="string">&quot;foo&quot;</span>))
.arg(Arg::with_name(<span class="string">&quot;bar&quot;</span>))
.arg(Arg::with_name(<span class="string">&quot;baz&quot;</span>).multiple(<span class="bool-val">true</span>))
.get_matches_from(<span class="macro">vec!</span>[
<span class="string">&quot;prog&quot;</span>, <span class="string">&quot;--&quot;</span>, <span class="string">&quot;baz1&quot;</span>, <span class="string">&quot;baz2&quot;</span>, <span class="string">&quot;baz3&quot;
</span>]);
<span class="macro">assert_eq!</span>(m.value_of(<span class="string">&quot;foo&quot;</span>), <span class="prelude-val">None</span>);
<span class="macro">assert_eq!</span>(m.value_of(<span class="string">&quot;bar&quot;</span>), <span class="prelude-val">None</span>);
<span class="macro">assert_eq!</span>(m.values_of(<span class="string">&quot;baz&quot;</span>).unwrap().collect::&lt;Vec&lt;<span class="kw">_</span>&gt;&gt;(), <span class="kw-2">&amp;</span>[<span class="string">&quot;baz1&quot;</span>, <span class="string">&quot;baz2&quot;</span>, <span class="string">&quot;baz3&quot;</span>]);</code></pre></div>
</div><h3 id="variant.AllowExternalSubcommands" class="variant small-section-header"><a href="#variant.AllowExternalSubcommands" class="anchor field"></a><code>AllowExternalSubcommands</code></h3><div class="docblock"><p>Specifies that an unexpected positional argument,
which would otherwise cause a <a href="./enum.ErrorKind.html#variant.UnknownArgument"><code>ErrorKind::UnknownArgument</code></a> error,
should instead be treated as a <a href="./struct.SubCommand.html"><code>SubCommand</code></a> within the <a href="./struct.ArgMatches.html"><code>ArgMatches</code></a> struct.</p>
<p><strong>NOTE:</strong> Use this setting with caution,
as a truly unexpected argument (i.e. one that is <em>NOT</em> an external subcommand)
will <strong>not</strong> cause an error and instead be treated as a potential subcommand.
One should check for such cases manually and inform the user appropriately.</p>
<h4 id="examples-4"><a href="#examples-4">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// Assume there is an external subcommand named &quot;subcmd&quot;
</span><span class="kw">let </span>m = App::new(<span class="string">&quot;myprog&quot;</span>)
.setting(AppSettings::AllowExternalSubcommands)
.get_matches_from(<span class="macro">vec!</span>[
<span class="string">&quot;myprog&quot;</span>, <span class="string">&quot;subcmd&quot;</span>, <span class="string">&quot;--option&quot;</span>, <span class="string">&quot;value&quot;</span>, <span class="string">&quot;-fff&quot;</span>, <span class="string">&quot;--flag&quot;
</span>]);
<span class="comment">// All trailing arguments will be stored under the subcommand&#39;s sub-matches using an empty
// string argument name
</span><span class="kw">match </span>m.subcommand() {
(external, <span class="prelude-val">Some</span>(ext_m)) =&gt; {
<span class="kw">let </span>ext_args: Vec&lt;<span class="kw-2">&amp;</span>str&gt; = ext_m.values_of(<span class="string">&quot;&quot;</span>).unwrap().collect();
<span class="macro">assert_eq!</span>(external, <span class="string">&quot;subcmd&quot;</span>);
<span class="macro">assert_eq!</span>(ext_args, [<span class="string">&quot;--option&quot;</span>, <span class="string">&quot;value&quot;</span>, <span class="string">&quot;-fff&quot;</span>, <span class="string">&quot;--flag&quot;</span>]);
},
<span class="kw">_ </span>=&gt; {},
}</code></pre></div>
</div><h3 id="variant.ArgsNegateSubcommands" class="variant small-section-header"><a href="#variant.ArgsNegateSubcommands" class="anchor field"></a><code>ArgsNegateSubcommands</code></h3><div class="docblock"><p>Specifies that use of a valid <a href="./struct.Arg.html">argument</a> negates <a href="./struct.SubCommand.html">subcommands</a> being used after. By default
<code>clap</code> allows arguments between subcommands such as
<code>&lt;cmd&gt; [cmd_args] &lt;cmd2&gt; [cmd2_args] &lt;cmd3&gt; [cmd3_args]</code>. This setting disables that
functionality and says that arguments can only follow the <em>final</em> subcommand. For instance
using this setting makes only the following invocations possible:</p>
<ul>
<li><code>&lt;cmd&gt; &lt;cmd2&gt; &lt;cmd3&gt; [cmd3_args]</code></li>
<li><code>&lt;cmd&gt; &lt;cmd2&gt; [cmd2_args]</code></li>
<li><code>&lt;cmd&gt; [cmd_args]</code></li>
</ul>
<h4 id="examples-5"><a href="#examples-5">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>App::new(<span class="string">&quot;myprog&quot;</span>)
.setting(AppSettings::ArgsNegateSubcommands)</code></pre></div>
</div><h3 id="variant.ArgRequiredElseHelp" class="variant small-section-header"><a href="#variant.ArgRequiredElseHelp" class="anchor field"></a><code>ArgRequiredElseHelp</code></h3><div class="docblock"><p>Specifies that the help text should be displayed (and then exit gracefully),
if no arguments are present at runtime (i.e. an empty run such as, <code>$ myprog</code>.</p>
<p><strong>NOTE:</strong> <a href="./struct.SubCommand.html"><code>SubCommand</code></a>s count as arguments</p>
<p><strong>NOTE:</strong> Setting <a href="./struct.Arg.html#method.default_value"><code>Arg::default_value</code></a> effectively disables this option as it will
ensure that some argument is always present.</p>
<h4 id="examples-6"><a href="#examples-6">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>App::new(<span class="string">&quot;myprog&quot;</span>)
.setting(AppSettings::ArgRequiredElseHelp)</code></pre></div>
</div><h3 id="variant.ColoredHelp" class="variant small-section-header"><a href="#variant.ColoredHelp" class="anchor field"></a><code>ColoredHelp</code></h3><div class="docblock"><p>Uses colorized help messages.</p>
<p><strong>NOTE:</strong> Must be compiled with the <code>color</code> cargo feature</p>
<h4 id="platform-specific-1"><a href="#platform-specific-1">Platform Specific</a></h4>
<p>This setting only applies to Unix, Linux, and macOS (i.e. non-Windows platforms)</p>
<h4 id="examples-7"><a href="#examples-7">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>App::new(<span class="string">&quot;myprog&quot;</span>)
.setting(AppSettings::ColoredHelp)
.get_matches();</code></pre></div>
</div><h3 id="variant.ColorAuto" class="variant small-section-header"><a href="#variant.ColorAuto" class="anchor field"></a><code>ColorAuto</code></h3><div class="docblock"><p>Enables colored output only when the output is going to a terminal or TTY.</p>
<p><strong>NOTE:</strong> This is the default behavior of <code>clap</code>.</p>
<p><strong>NOTE:</strong> Must be compiled with the <code>color</code> cargo feature.</p>
<h4 id="platform-specific-2"><a href="#platform-specific-2">Platform Specific</a></h4>
<p>This setting only applies to Unix, Linux, and macOS (i.e. non-Windows platforms).</p>
<h4 id="examples-8"><a href="#examples-8">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>App::new(<span class="string">&quot;myprog&quot;</span>)
.setting(AppSettings::ColorAuto)
.get_matches();</code></pre></div>
</div><h3 id="variant.ColorAlways" class="variant small-section-header"><a href="#variant.ColorAlways" class="anchor field"></a><code>ColorAlways</code></h3><div class="docblock"><p>Enables colored output regardless of whether or not the output is going to a terminal/TTY.</p>
<p><strong>NOTE:</strong> Must be compiled with the <code>color</code> cargo feature.</p>
<h4 id="platform-specific-3"><a href="#platform-specific-3">Platform Specific</a></h4>
<p>This setting only applies to Unix, Linux, and macOS (i.e. non-Windows platforms).</p>
<h4 id="examples-9"><a href="#examples-9">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>App::new(<span class="string">&quot;myprog&quot;</span>)
.setting(AppSettings::ColorAlways)
.get_matches();</code></pre></div>
</div><h3 id="variant.ColorNever" class="variant small-section-header"><a href="#variant.ColorNever" class="anchor field"></a><code>ColorNever</code></h3><div class="docblock"><p>Disables colored output no matter if the output is going to a terminal/TTY, or not.</p>
<p><strong>NOTE:</strong> Must be compiled with the <code>color</code> cargo feature</p>
<h4 id="platform-specific-4"><a href="#platform-specific-4">Platform Specific</a></h4>
<p>This setting only applies to Unix, Linux, and macOS (i.e. non-Windows platforms)</p>
<h4 id="examples-10"><a href="#examples-10">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>App::new(<span class="string">&quot;myprog&quot;</span>)
.setting(AppSettings::ColorNever)
.get_matches();</code></pre></div>
</div><h3 id="variant.DontCollapseArgsInUsage" class="variant small-section-header"><a href="#variant.DontCollapseArgsInUsage" class="anchor field"></a><code>DontCollapseArgsInUsage</code></h3><div class="docblock"><p>Disables the automatic collapsing of positional args into <code>[ARGS]</code> inside the usage string</p>
<h4 id="examples-11"><a href="#examples-11">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>App::new(<span class="string">&quot;myprog&quot;</span>)
.setting(AppSettings::DontCollapseArgsInUsage)
.get_matches();</code></pre></div>
</div><h3 id="variant.DontDelimitTrailingValues" class="variant small-section-header"><a href="#variant.DontDelimitTrailingValues" class="anchor field"></a><code>DontDelimitTrailingValues</code></h3><div class="docblock"><p>Disables the automatic delimiting of values when <code>--</code> or <a href="./enum.AppSettings.html#variant.TrailingVarArg"><code>AppSettings::TrailingVarArg</code></a>
was used.</p>
<p><strong>NOTE:</strong> The same thing can be done manually by setting the final positional argument to
<a href="./struct.Arg.html#method.use_delimiter"><code>Arg::use_delimiter(false)</code></a>. Using this setting is safer, because it’s easier to locate
when making changes.</p>
<h4 id="examples-12"><a href="#examples-12">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>App::new(<span class="string">&quot;myprog&quot;</span>)
.setting(AppSettings::DontDelimitTrailingValues)
.get_matches();</code></pre></div>
</div><h3 id="variant.DisableHelpFlags" class="variant small-section-header"><a href="#variant.DisableHelpFlags" class="anchor field"></a><code>DisableHelpFlags</code></h3><div class="docblock"><p>Disables <code>-h</code> and <code>--help</code> <a href="./struct.App.html"><code>App</code></a> without affecting any of the <a href="./struct.SubCommand.html"><code>SubCommand</code></a>s
(Defaults to <code>false</code>; application <em>does</em> have help flags)</p>
<h4 id="examples-13"><a href="#examples-13">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>res = App::new(<span class="string">&quot;myprog&quot;</span>)
.setting(AppSettings::DisableHelpFlags)
.get_matches_from_safe(<span class="macro">vec!</span>[
<span class="string">&quot;myprog&quot;</span>, <span class="string">&quot;-h&quot;
</span>]);
<span class="macro">assert!</span>(res.is_err());
<span class="macro">assert_eq!</span>(res.unwrap_err().kind, ErrorKind::UnknownArgument);</code></pre></div>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>res = App::new(<span class="string">&quot;myprog&quot;</span>)
.setting(AppSettings::DisableHelpFlags)
.subcommand(SubCommand::with_name(<span class="string">&quot;test&quot;</span>))
.get_matches_from_safe(<span class="macro">vec!</span>[
<span class="string">&quot;myprog&quot;</span>, <span class="string">&quot;test&quot;</span>, <span class="string">&quot;-h&quot;
</span>]);
<span class="macro">assert!</span>(res.is_err());
<span class="macro">assert_eq!</span>(res.unwrap_err().kind, ErrorKind::HelpDisplayed);</code></pre></div>
</div><h3 id="variant.DisableHelpSubcommand" class="variant small-section-header"><a href="#variant.DisableHelpSubcommand" class="anchor field"></a><code>DisableHelpSubcommand</code></h3><div class="docblock"><p>Disables the <code>help</code> subcommand</p>
<h4 id="examples-14"><a href="#examples-14">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>res = App::new(<span class="string">&quot;myprog&quot;</span>)
.version(<span class="string">&quot;v1.1&quot;</span>)
.setting(AppSettings::DisableHelpSubcommand)
<span class="comment">// Normally, creating a subcommand causes a `help` subcommand to automatically
// be generated as well
</span>.subcommand(SubCommand::with_name(<span class="string">&quot;test&quot;</span>))
.get_matches_from_safe(<span class="macro">vec!</span>[
<span class="string">&quot;myprog&quot;</span>, <span class="string">&quot;help&quot;
</span>]);
<span class="macro">assert!</span>(res.is_err());
<span class="macro">assert_eq!</span>(res.unwrap_err().kind, ErrorKind::UnknownArgument);</code></pre></div>
</div><h3 id="variant.DisableVersion" class="variant small-section-header"><a href="#variant.DisableVersion" class="anchor field"></a><code>DisableVersion</code></h3><div class="docblock"><p>Disables <code>-V</code> and <code>--version</code> <a href="./struct.App.html"><code>App</code></a> without affecting any of the <a href="./struct.SubCommand.html"><code>SubCommand</code></a>s
(Defaults to <code>false</code>; application <em>does</em> have a version flag)</p>
<h4 id="examples-15"><a href="#examples-15">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>res = App::new(<span class="string">&quot;myprog&quot;</span>)
.version(<span class="string">&quot;v1.1&quot;</span>)
.setting(AppSettings::DisableVersion)
.get_matches_from_safe(<span class="macro">vec!</span>[
<span class="string">&quot;myprog&quot;</span>, <span class="string">&quot;-V&quot;
</span>]);
<span class="macro">assert!</span>(res.is_err());
<span class="macro">assert_eq!</span>(res.unwrap_err().kind, ErrorKind::UnknownArgument);</code></pre></div>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>res = App::new(<span class="string">&quot;myprog&quot;</span>)
.version(<span class="string">&quot;v1.1&quot;</span>)
.setting(AppSettings::DisableVersion)
.subcommand(SubCommand::with_name(<span class="string">&quot;test&quot;</span>))
.get_matches_from_safe(<span class="macro">vec!</span>[
<span class="string">&quot;myprog&quot;</span>, <span class="string">&quot;test&quot;</span>, <span class="string">&quot;-V&quot;
</span>]);
<span class="macro">assert!</span>(res.is_err());
<span class="macro">assert_eq!</span>(res.unwrap_err().kind, ErrorKind::VersionDisplayed);</code></pre></div>
</div><h3 id="variant.DeriveDisplayOrder" class="variant small-section-header"><a href="#variant.DeriveDisplayOrder" class="anchor field"></a><code>DeriveDisplayOrder</code></h3><div class="docblock"><p>Displays the arguments and <a href="./struct.SubCommand.html"><code>SubCommand</code></a>s in the help message in the order that they were
declared in, and not alphabetically which is the default.</p>
<h4 id="examples-16"><a href="#examples-16">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>App::new(<span class="string">&quot;myprog&quot;</span>)
.setting(AppSettings::DeriveDisplayOrder)
.get_matches();</code></pre></div>
</div><h3 id="variant.GlobalVersion" class="variant small-section-header"><a href="#variant.GlobalVersion" class="anchor field"></a><code>GlobalVersion</code></h3><div class="docblock"><p>Specifies to use the version of the current command for all child <a href="./struct.SubCommand.html"><code>SubCommand</code></a>s.
(Defaults to <code>false</code>; subcommands have independent version strings from their parents.)</p>
<p><strong>NOTE:</strong> The version for the current command <strong>and</strong> this setting must be set <strong>prior</strong> to
adding any child subcommands</p>
<h4 id="examples-17"><a href="#examples-17">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>App::new(<span class="string">&quot;myprog&quot;</span>)
.version(<span class="string">&quot;v1.1&quot;</span>)
.setting(AppSettings::GlobalVersion)
.subcommand(SubCommand::with_name(<span class="string">&quot;test&quot;</span>))
.get_matches();
<span class="comment">// running `$ myprog test --version` will display
// &quot;myprog-test v1.1&quot;</span></code></pre></div>
</div><h3 id="variant.Hidden" class="variant small-section-header"><a href="#variant.Hidden" class="anchor field"></a><code>Hidden</code></h3><div class="docblock"><p>Specifies that this <a href="./struct.SubCommand.html"><code>SubCommand</code></a> should be hidden from help messages</p>
<h4 id="examples-18"><a href="#examples-18">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>App::new(<span class="string">&quot;myprog&quot;</span>)
.subcommand(SubCommand::with_name(<span class="string">&quot;test&quot;</span>)
.setting(AppSettings::Hidden))</code></pre></div>
</div><h3 id="variant.HidePossibleValuesInHelp" class="variant small-section-header"><a href="#variant.HidePossibleValuesInHelp" class="anchor field"></a><code>HidePossibleValuesInHelp</code></h3><div class="docblock"><p>Tells <code>clap</code> <em>not</em> to print possible values when displaying help information.
This can be useful if there are many values, or they are explained elsewhere.</p>
</div><h3 id="variant.InferSubcommands" class="variant small-section-header"><a href="#variant.InferSubcommands" class="anchor field"></a><code>InferSubcommands</code></h3><div class="docblock"><p>Tries to match unknown args to partial <a href="./struct.SubCommand.html"><code>subcommands</code></a> or their <a href="./struct.App.html#method.alias">aliases</a>. For example to
match a subcommand named <code>test</code>, one could use <code>t</code>, <code>te</code>, <code>tes</code>, and <code>test</code>.</p>
<p><strong>NOTE:</strong> The match <em>must not</em> be ambiguous at all in order to succeed. i.e. to match <code>te</code>
to <code>test</code> there could not also be a subcommand or alias <code>temp</code> because both start with <code>te</code></p>
<p><strong>CAUTION:</strong> This setting can interfere with <a href="./struct.Arg.html#method.index">positional/free arguments</a>, take care when
designing CLIs which allow inferred subcommands and have potential positional/free
arguments whose values could start with the same characters as subcommands. If this is the
case, it’s recommended to use settings such as <a href="./enum.AppSettings.html#variant.ArgsNegateSubcommands"><code>AppSeettings::ArgsNegateSubcommands</code></a> in
conjunction with this setting.</p>
<h4 id="examples-19"><a href="#examples-19">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>m = App::new(<span class="string">&quot;prog&quot;</span>)
.setting(AppSettings::InferSubcommands)
.subcommand(SubCommand::with_name(<span class="string">&quot;test&quot;</span>))
.get_matches_from(<span class="macro">vec!</span>[
<span class="string">&quot;prog&quot;</span>, <span class="string">&quot;te&quot;
</span>]);
<span class="macro">assert_eq!</span>(m.subcommand_name(), <span class="prelude-val">Some</span>(<span class="string">&quot;test&quot;</span>));</code></pre></div>
</div><h3 id="variant.NoBinaryName" class="variant small-section-header"><a href="#variant.NoBinaryName" class="anchor field"></a><code>NoBinaryName</code></h3><div class="docblock"><p>Specifies that the parser should not assume the first argument passed is the binary name.
This is normally the case when using a “daemon” style mode, or an interactive CLI where one
one would not normally type the binary or program name for each command.</p>
<h4 id="examples-20"><a href="#examples-20">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>m = App::new(<span class="string">&quot;myprog&quot;</span>)
.setting(AppSettings::NoBinaryName)
.arg(Arg::from_usage(<span class="string">&quot;&lt;cmd&gt;... &#39;commands to run&#39;&quot;</span>))
.get_matches_from(<span class="macro">vec!</span>[<span class="string">&quot;command&quot;</span>, <span class="string">&quot;set&quot;</span>]);
<span class="kw">let </span>cmds: Vec&lt;<span class="kw-2">&amp;</span>str&gt; = m.values_of(<span class="string">&quot;cmd&quot;</span>).unwrap().collect();
<span class="macro">assert_eq!</span>(cmds, [<span class="string">&quot;command&quot;</span>, <span class="string">&quot;set&quot;</span>]);</code></pre></div>
</div><h3 id="variant.NextLineHelp" class="variant small-section-header"><a href="#variant.NextLineHelp" class="anchor field"></a><code>NextLineHelp</code></h3><div class="docblock"><p>Places the help string for all arguments on the line after the argument.</p>
<h4 id="examples-21"><a href="#examples-21">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>App::new(<span class="string">&quot;myprog&quot;</span>)
.setting(AppSettings::NextLineHelp)
.get_matches();</code></pre></div>
</div><h3 id="variant.PropagateGlobalValuesDown" class="variant small-section-header"><a href="#variant.PropagateGlobalValuesDown" class="anchor field"></a><code>PropagateGlobalValuesDown</code></h3><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 2.27.0: No longer required to propagate values</span></div></span><div class="docblock"><p><strong>DEPRECATED</strong>: This setting is no longer required in order to propagate values up or down</p>
<p>Specifies that the parser should propagate global arg’s values down or up through any <em>used</em>
child subcommands. Meaning, if a subcommand wasn’t used, the values won’t be propagated to
said subcommand.</p>
<h4 id="examples-22"><a href="#examples-22">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>m = App::new(<span class="string">&quot;myprog&quot;</span>)
.arg(Arg::from_usage(<span class="string">&quot;[cmd] &#39;command to run&#39;&quot;</span>)
.global(<span class="bool-val">true</span>))
.subcommand(SubCommand::with_name(<span class="string">&quot;foo&quot;</span>))
.get_matches_from(<span class="macro">vec!</span>[<span class="string">&quot;myprog&quot;</span>, <span class="string">&quot;set&quot;</span>, <span class="string">&quot;foo&quot;</span>]);
<span class="macro">assert_eq!</span>(m.value_of(<span class="string">&quot;cmd&quot;</span>), <span class="prelude-val">Some</span>(<span class="string">&quot;set&quot;</span>));
<span class="kw">let </span>sub_m = m.subcommand_matches(<span class="string">&quot;foo&quot;</span>).unwrap();
<span class="macro">assert_eq!</span>(sub_m.value_of(<span class="string">&quot;cmd&quot;</span>), <span class="prelude-val">Some</span>(<span class="string">&quot;set&quot;</span>));</code></pre></div>
<p>Now doing the same thing, but <em>not</em> using any subcommands will result in the value not being
propagated down.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>m = App::new(<span class="string">&quot;myprog&quot;</span>)
.arg(Arg::from_usage(<span class="string">&quot;[cmd] &#39;command to run&#39;&quot;</span>)
.global(<span class="bool-val">true</span>))
.subcommand(SubCommand::with_name(<span class="string">&quot;foo&quot;</span>))
.get_matches_from(<span class="macro">vec!</span>[<span class="string">&quot;myprog&quot;</span>, <span class="string">&quot;set&quot;</span>]);
<span class="macro">assert_eq!</span>(m.value_of(<span class="string">&quot;cmd&quot;</span>), <span class="prelude-val">Some</span>(<span class="string">&quot;set&quot;</span>));
<span class="macro">assert!</span>(m.subcommand_matches(<span class="string">&quot;foo&quot;</span>).is_none());</code></pre></div>
</div><h3 id="variant.SubcommandsNegateReqs" class="variant small-section-header"><a href="#variant.SubcommandsNegateReqs" class="anchor field"></a><code>SubcommandsNegateReqs</code></h3><div class="docblock"><p>Allows <a href="./struct.SubCommand.html"><code>SubCommand</code></a>s to override all requirements of the parent command.
For example if you had a subcommand or top level application with a required argument
that is only required as long as there is no subcommand present,
using this setting would allow you to set those arguments to <a href="./struct.Arg.html#method.required"><code>Arg::required(true)</code></a>
and yet receive no error so long as the user uses a valid subcommand instead.</p>
<p><strong>NOTE:</strong> This defaults to false (using subcommand does <em>not</em> negate requirements)</p>
<h4 id="examples-23"><a href="#examples-23">Examples</a></h4>
<p>This first example shows that it is an error to not use a required argument</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>err = App::new(<span class="string">&quot;myprog&quot;</span>)
.setting(AppSettings::SubcommandsNegateReqs)
.arg(Arg::with_name(<span class="string">&quot;opt&quot;</span>).required(<span class="bool-val">true</span>))
.subcommand(SubCommand::with_name(<span class="string">&quot;test&quot;</span>))
.get_matches_from_safe(<span class="macro">vec!</span>[
<span class="string">&quot;myprog&quot;
</span>]);
<span class="macro">assert!</span>(err.is_err());
<span class="macro">assert_eq!</span>(err.unwrap_err().kind, ErrorKind::MissingRequiredArgument);</code></pre></div>
<p>This next example shows that it is no longer error to not use a required argument if a
valid subcommand is used.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>noerr = App::new(<span class="string">&quot;myprog&quot;</span>)
.setting(AppSettings::SubcommandsNegateReqs)
.arg(Arg::with_name(<span class="string">&quot;opt&quot;</span>).required(<span class="bool-val">true</span>))
.subcommand(SubCommand::with_name(<span class="string">&quot;test&quot;</span>))
.get_matches_from_safe(<span class="macro">vec!</span>[
<span class="string">&quot;myprog&quot;</span>, <span class="string">&quot;test&quot;
</span>]);
<span class="macro">assert!</span>(noerr.is_ok());</code></pre></div>
</div><h3 id="variant.SubcommandRequiredElseHelp" class="variant small-section-header"><a href="#variant.SubcommandRequiredElseHelp" class="anchor field"></a><code>SubcommandRequiredElseHelp</code></h3><div class="docblock"><p>Specifies that the help text should be displayed (before exiting gracefully) if no
<a href="./struct.SubCommand.html"><code>SubCommand</code></a>s are present at runtime (i.e. an empty run such as <code>$ myprog</code>).</p>
<p><strong>NOTE:</strong> This should <em>not</em> be used with <a href="./enum.AppSettings.html#variant.SubcommandRequired"><code>AppSettings::SubcommandRequired</code></a> as they do
nearly same thing; this prints the help text, and the other prints an error.</p>
<p><strong>NOTE:</strong> If the user specifies arguments at runtime, but no subcommand the help text will
still be displayed and exit. If this is <em>not</em> the desired result, consider using
<a href="./enum.AppSettings.html#variant.ArgRequiredElseHelp"><code>AppSettings::ArgRequiredElseHelp</code></a> instead.</p>
<h4 id="examples-24"><a href="#examples-24">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>App::new(<span class="string">&quot;myprog&quot;</span>)
.setting(AppSettings::SubcommandRequiredElseHelp)</code></pre></div>
</div><h3 id="variant.StrictUtf8" class="variant small-section-header"><a href="#variant.StrictUtf8" class="anchor field"></a><code>StrictUtf8</code></h3><div class="docblock"><p>Specifies that any invalid UTF-8 code points should be treated as an error and fail
with a <a href="./enum.ErrorKind.html#variant.InvalidUtf8"><code>ErrorKind::InvalidUtf8</code></a> error.</p>
<p><strong>NOTE:</strong> This rule only applies to argument values; Things such as flags, options, and
<a href="./struct.SubCommand.html"><code>SubCommand</code></a>s themselves only allow valid UTF-8 code points.</p>
<h4 id="platform-specific-5"><a href="#platform-specific-5">Platform Specific</a></h4>
<p>Non Windows systems only</p>
<h4 id="examples-25"><a href="#examples-25">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::ffi::OsString;
<span class="kw">use </span>std::os::unix::ffi::OsStringExt;
<span class="kw">let </span>m = App::new(<span class="string">&quot;myprog&quot;</span>)
.setting(AppSettings::StrictUtf8)
.arg_from_usage(<span class="string">&quot;&lt;arg&gt; &#39;some positional arg&#39;&quot;</span>)
.get_matches_from_safe(
<span class="macro">vec!</span>[
OsString::from(<span class="string">&quot;myprog&quot;</span>),
OsString::from_vec(<span class="macro">vec!</span>[<span class="number">0xe9</span>])]);
<span class="macro">assert!</span>(m.is_err());
<span class="macro">assert_eq!</span>(m.unwrap_err().kind, ErrorKind::InvalidUtf8);</code></pre></div>
</div><h3 id="variant.SubcommandRequired" class="variant small-section-header"><a href="#variant.SubcommandRequired" class="anchor field"></a><code>SubcommandRequired</code></h3><div class="docblock"><p>Allows specifying that if no <a href="./struct.SubCommand.html"><code>SubCommand</code></a> is present at runtime,
error and exit gracefully.</p>
<p><strong>NOTE:</strong> This defaults to <code>false</code> (subcommands do <em>not</em> need to be present)</p>
<h4 id="examples-26"><a href="#examples-26">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>err = App::new(<span class="string">&quot;myprog&quot;</span>)
.setting(AppSettings::SubcommandRequired)
.subcommand(SubCommand::with_name(<span class="string">&quot;test&quot;</span>))
.get_matches_from_safe(<span class="macro">vec!</span>[
<span class="string">&quot;myprog&quot;</span>,
]);
<span class="macro">assert!</span>(err.is_err());
<span class="macro">assert_eq!</span>(err.unwrap_err().kind, ErrorKind::MissingSubcommand);</code></pre></div>
</div><h3 id="variant.TrailingVarArg" class="variant small-section-header"><a href="#variant.TrailingVarArg" class="anchor field"></a><code>TrailingVarArg</code></h3><div class="docblock"><p>Specifies that the final positional argument is a “VarArg” and that <code>clap</code> should not
attempt to parse any further args.</p>
<p>The values of the trailing positional argument will contain all args from itself on.</p>
<p><strong>NOTE:</strong> The final positional argument <strong>must</strong> have <a href="./struct.Arg.html#method.multiple"><code>Arg::multiple(true)</code></a> or the usage
string equivalent.</p>
<h4 id="examples-27"><a href="#examples-27">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>m = App::new(<span class="string">&quot;myprog&quot;</span>)
.setting(AppSettings::TrailingVarArg)
.arg(Arg::from_usage(<span class="string">&quot;&lt;cmd&gt;... &#39;commands to run&#39;&quot;</span>))
.get_matches_from(<span class="macro">vec!</span>[<span class="string">&quot;myprog&quot;</span>, <span class="string">&quot;arg1&quot;</span>, <span class="string">&quot;-r&quot;</span>, <span class="string">&quot;val1&quot;</span>]);
<span class="kw">let </span>trail: Vec&lt;<span class="kw-2">&amp;</span>str&gt; = m.values_of(<span class="string">&quot;cmd&quot;</span>).unwrap().collect();
<span class="macro">assert_eq!</span>(trail, [<span class="string">&quot;arg1&quot;</span>, <span class="string">&quot;-r&quot;</span>, <span class="string">&quot;val1&quot;</span>]);</code></pre></div>
</div><h3 id="variant.UnifiedHelpMessage" class="variant small-section-header"><a href="#variant.UnifiedHelpMessage" class="anchor field"></a><code>UnifiedHelpMessage</code></h3><div class="docblock"><p>Groups flags and options together, presenting a more unified help message
(a la <code>getopts</code> or <code>docopt</code> style).</p>
<p>The default is that the auto-generated help message will group flags, and options
separately.</p>
<p><strong>NOTE:</strong> This setting is cosmetic only and does not affect any functionality.</p>
<h4 id="examples-28"><a href="#examples-28">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>App::new(<span class="string">&quot;myprog&quot;</span>)
.setting(AppSettings::UnifiedHelpMessage)
.get_matches();
<span class="comment">// running `myprog --help` will display a unified &quot;docopt&quot; or &quot;getopts&quot; style help message</span></code></pre></div>
</div><h3 id="variant.VersionlessSubcommands" class="variant small-section-header"><a href="#variant.VersionlessSubcommands" class="anchor field"></a><code>VersionlessSubcommands</code></h3><div class="docblock"><p>Disables <code>-V</code> and <code>--version</code> for all <a href="./struct.SubCommand.html"><code>SubCommand</code></a>s
(Defaults to <code>false</code>; subcommands <em>do</em> have version flags.)</p>
<p><strong>NOTE:</strong> This setting must be set <strong>prior</strong> to adding any subcommands.</p>
<h4 id="examples-29"><a href="#examples-29">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>res = App::new(<span class="string">&quot;myprog&quot;</span>)
.version(<span class="string">&quot;v1.1&quot;</span>)
.setting(AppSettings::VersionlessSubcommands)
.subcommand(SubCommand::with_name(<span class="string">&quot;test&quot;</span>))
.get_matches_from_safe(<span class="macro">vec!</span>[
<span class="string">&quot;myprog&quot;</span>, <span class="string">&quot;test&quot;</span>, <span class="string">&quot;-V&quot;
</span>]);
<span class="macro">assert!</span>(res.is_err());
<span class="macro">assert_eq!</span>(res.unwrap_err().kind, ErrorKind::UnknownArgument);</code></pre></div>
</div><h3 id="variant.WaitOnError" class="variant small-section-header"><a href="#variant.WaitOnError" class="anchor field"></a><code>WaitOnError</code></h3><div class="docblock"><p>Will display a message “Press [ENTER]/[RETURN] to continue…” and wait for user before
exiting</p>
<p>This is most useful when writing an application which is run from a GUI shortcut, or on
Windows where a user tries to open the binary by double-clicking instead of using the
command line.</p>
<p><strong>NOTE:</strong> This setting is <strong>not</strong> recursive with <a href="./struct.SubCommand.html"><code>SubCommand</code></a>s, meaning if you wish this
behavior for all subcommands, you must set this on each command (needing this is extremely
rare)</p>
<h4 id="examples-30"><a href="#examples-30">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>App::new(<span class="string">&quot;myprog&quot;</span>)
.setting(AppSettings::WaitOnError)</code></pre></div>
</div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Clone-for-AppSettings" class="impl has-srclink"><a class="srclink rightside" href="../src/clap/app/settings.rs.html#138">source</a><a href="#impl-Clone-for-AppSettings" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="enum.AppSettings.html" title="enum clap::AppSettings">AppSettings</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/clap/app/settings.rs.html#138">source</a><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="enum" href="enum.AppSettings.html" title="enum clap::AppSettings">AppSettings</a></h4></section></summary><div class='docblock'>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#132-134">source</a></span><a href="#method.clone_from" class="anchor"></a><h4 class="code-header">const fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</h4></section></summary><div class='docblock'>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Debug-for-AppSettings" class="impl has-srclink"><a class="srclink rightside" href="../src/clap/app/settings.rs.html#138">source</a><a href="#impl-Debug-for-AppSettings" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="enum.AppSettings.html" title="enum clap::AppSettings">AppSettings</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/clap/app/settings.rs.html#138">source</a><a href="#method.fmt" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-FromStr-for-AppSettings" class="impl has-srclink"><a class="srclink rightside" href="../src/clap/app/settings.rs.html#1000-1042">source</a><a href="#impl-FromStr-for-AppSettings" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a> for <a class="enum" href="enum.AppSettings.html" title="enum clap::AppSettings">AppSettings</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Err" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Err" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#associatedtype.Err" class="associatedtype">Err</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></h4></section></summary><div class='docblock'>The associated error which can be returned from parsing.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_str" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/clap/app/settings.rs.html#1002-1041">source</a><a href="#method.from_str" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#tymethod.from_str" class="fnname">from_str</a>(s: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, &lt;Self as <a class="trait" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html" title="trait core::str::traits::FromStr">FromStr</a>&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#associatedtype.Err" title="type core::str::traits::FromStr::Err">Err</a>&gt;</h4></section></summary><div class='docblock'>Parses a string <code>s</code> to return a value of this type. <a href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#tymethod.from_str">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-PartialEq%3CAppSettings%3E-for-AppSettings" class="impl has-srclink"><a class="srclink rightside" href="../src/clap/app/settings.rs.html#138">source</a><a href="#impl-PartialEq%3CAppSettings%3E-for-AppSettings" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>&lt;<a class="enum" href="enum.AppSettings.html" title="enum clap::AppSettings">AppSettings</a>&gt; for <a class="enum" href="enum.AppSettings.html" title="enum clap::AppSettings">AppSettings</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.eq" class="method trait-impl has-srclink"><a class="srclink rightside" href="../src/clap/app/settings.rs.html#138">source</a><a href="#method.eq" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq" class="fnname">eq</a>(&amp;self, other: &amp;<a class="enum" href="enum.AppSettings.html" title="enum clap::AppSettings">AppSettings</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.ne" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#227">source</a></span><a href="#method.ne" class="anchor"></a><h4 class="code-header">const fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne" class="fnname">ne</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne">Read more</a></div></details></div></details><section id="impl-Copy-for-AppSettings" class="impl has-srclink"><a class="srclink rightside" href="../src/clap/app/settings.rs.html#138">source</a><a href="#impl-Copy-for-AppSettings" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="enum" href="enum.AppSettings.html" title="enum clap::AppSettings">AppSettings</a></h3></section><section id="impl-StructuralPartialEq-for-AppSettings" class="impl has-srclink"><a class="srclink rightside" href="../src/clap/app/settings.rs.html#138">source</a><a href="#impl-StructuralPartialEq-for-AppSettings" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="enum.AppSettings.html" title="enum clap::AppSettings">AppSettings</a></h3></section></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><section id="impl-RefUnwindSafe-for-AppSettings" class="impl has-srclink"><a href="#impl-RefUnwindSafe-for-AppSettings" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="enum.AppSettings.html" title="enum clap::AppSettings">AppSettings</a></h3></section><section id="impl-Send-for-AppSettings" class="impl has-srclink"><a href="#impl-Send-for-AppSettings" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="enum.AppSettings.html" title="enum clap::AppSettings">AppSettings</a></h3></section><section id="impl-Sync-for-AppSettings" class="impl has-srclink"><a href="#impl-Sync-for-AppSettings" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="enum.AppSettings.html" title="enum clap::AppSettings">AppSettings</a></h3></section><section id="impl-Unpin-for-AppSettings" class="impl has-srclink"><a href="#impl-Unpin-for-AppSettings" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="enum.AppSettings.html" title="enum clap::AppSettings">AppSettings</a></h3></section><section id="impl-UnwindSafe-for-AppSettings" class="impl has-srclink"><a href="#impl-UnwindSafe-for-AppSettings" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="enum" href="enum.AppSettings.html" title="enum clap::AppSettings">AppSettings</a></h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any-for-AppSettings" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#200">source</a><a href="#impl-Any-for-AppSettings" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#201">source</a><a href="#method.type_id" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-AppSettings" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211">source</a><a href="#impl-Borrow%3CT%3E-for-AppSettings" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213">source</a></span><a href="#method.borrow" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-AppSettings" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#220">source</a><a href="#impl-BorrowMut%3CT%3E-for-AppSettings" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221">source</a></span><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-AppSettings" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#733">source</a><a href="#impl-From%3CT%3E-for-AppSettings" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#736">source</a></span><a href="#method.from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-AppSettings" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#717">source</a><a href="#impl-Into%3CU%3E-for-AppSettings" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#725">source</a></span><a href="#method.into" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
<p>That is, this conversion is whatever the implementation of
<code><a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="From">From</a>&lt;T&gt; for U</code> chooses to do.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-ToOwned-for-AppSettings" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#83">source</a><a href="#impl-ToOwned-for-AppSettings" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Owned" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Owned" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="associatedtype">Owned</a> = T</h4></section></summary><div class='docblock'>The resulting type after obtaining ownership.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.to_owned" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#88">source</a><a href="#method.to_owned" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fnname">to_owned</a>(&amp;self) -&gt; T</h4></section></summary><div class='docblock'>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_into" class="method trait-impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#92">source</a><a href="#method.clone_into" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fnname">clone_into</a>(&amp;self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T)</h4></section></summary><div class='docblock'>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-AppSettings" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#775">source</a><a href="#impl-TryFrom%3CU%3E-for-AppSettings" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#781">source</a></span><a href="#method.try_from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-AppSettings" class="impl has-srclink"><a class="srclink rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#760">source</a><a href="#impl-TryInto%3CU%3E-for-AppSettings" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#766">source</a></span><a href="#method.try_into" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="clap" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.0-nightly (5c8bff74b 2022-10-21)" ></div></body></html>