mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 14:22:34 +00:00
chore(docs): rebuild docs with nightly rustdoc
This commit is contained in:
parent
b4758fec6f
commit
71f60cc223
15 changed files with 153 additions and 71 deletions
|
@ -47,7 +47,7 @@
|
|||
<div class='docblock'>
|
||||
<h1 id="clap" class='section-header'><a
|
||||
href="#clap">clap</a></h1>
|
||||
<p><img src="https://travis-ci.org/kbknapp/clap-rs.svg?branch=master" alt="Travis-CI"> <a href="https://crates.io/crates/clap"><img src="http://meritbadge.herokuapp.com/clap" alt=""></a> <a href="https://gitter.im/kbknapp/clap-rs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"><img src="https://badges.gitter.im/Join%20Chat.svg" alt="Join the chat at https://gitter.im/kbknapp/clap-rs"></a></p>
|
||||
<p><img src="https://travis-ci.org/kbknapp/clap-rs.svg?branch=master" alt="Travis-CI"> <a href=""><img src="https://img.shields.io/crates/v/clap.svg" alt="Crates.io"></a> <a href=""><img src="https://img.shields.io/crates/l/clap.svg" alt="Crates.io"></a> <a href="https://gitter.im/kbknapp/clap-rs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"><img src="https://badges.gitter.im/Join%20Chat.svg" alt="Join the chat at https://gitter.im/kbknapp/clap-rs"></a></p>
|
||||
|
||||
<p>Command Line Argument Parser for Rust</p>
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
<section id='main' class="content macro">
|
||||
<h1 class='fqn'><span class='in-band'><a href='index.html'>clap</a>::<wbr><a class='macro' href=''>arg_enum!</a></span><span class='out-of-band'><span id='render-detail'>
|
||||
<a id="collapse-all" href="#">[-]</a> <a id="expand-all" href="#">[+]</a>
|
||||
</span><a id='src-10184' class='srclink' href='../src/clap/macros.rs.html#297-384'>[src]</a></span></h1>
|
||||
</span><a id='src-10305' class='srclink' href='../src/clap/macros.rs.html#297-384'>[src]</a></span></h1>
|
||||
<pre class='rust macro'>
|
||||
<span class='macro'>macro_rules</span><span class='macro'>!</span> <span class='ident'>arg_enum</span> {
|
||||
(<span class='kw'>enum</span> <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>e</span>:<span class='ident'>ident</span> { $(<span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>v</span>:<span class='ident'>ident</span>),<span class='op'>+</span> } ) <span class='op'>=></span> {
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
<section id='main' class="content macro">
|
||||
<h1 class='fqn'><span class='in-band'><a href='index.html'>clap</a>::<wbr><a class='macro' href=''>crate_version!</a></span><span class='out-of-band'><span id='render-detail'>
|
||||
<a id="collapse-all" href="#">[-]</a> <a id="expand-all" href="#">[+]</a>
|
||||
</span><a id='src-10185' class='srclink' href='../src/clap/macros.rs.html#400-408'>[src]</a></span></h1>
|
||||
</span><a id='src-10306' class='srclink' href='../src/clap/macros.rs.html#400-408'>[src]</a></span></h1>
|
||||
<pre class='rust macro'>
|
||||
<span class='macro'>macro_rules</span><span class='macro'>!</span> <span class='ident'>crate_version</span> {
|
||||
() <span class='op'>=></span> {
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
<section id='main' class="content macro">
|
||||
<h1 class='fqn'><span class='in-band'><a href='index.html'>clap</a>::<wbr><a class='macro' href=''>simple_enum!</a></span><span class='out-of-band'><span id='render-detail'>
|
||||
<a id="collapse-all" href="#">[-]</a> <a id="expand-all" href="#">[+]</a>
|
||||
</span><a id='src-10183' class='srclink' href='../src/clap/macros.rs.html#241-263'>[src]</a></span></h1>
|
||||
</span><a id='src-10304' class='srclink' href='../src/clap/macros.rs.html#241-263'>[src]</a></span></h1>
|
||||
<pre class='rust macro'>
|
||||
<span class='macro'>macro_rules</span><span class='macro'>!</span> <span class='ident'>simple_enum</span> {
|
||||
(<span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>e</span>:<span class='ident'>ident</span> <span class='op'>=></span> $(<span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>v</span>:<span class='ident'>ident</span>),<span class='op'>+</span>) <span class='op'>=></span> {
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
<section id='main' class="content macro">
|
||||
<h1 class='fqn'><span class='in-band'><a href='index.html'>clap</a>::<wbr><a class='macro' href=''>value_t!</a></span><span class='out-of-band'><span id='render-detail'>
|
||||
<a id="collapse-all" href="#">[-]</a> <a id="expand-all" href="#">[+]</a>
|
||||
</span><a id='src-10181' class='srclink' href='../src/clap/macros.rs.html#84-118'>[src]</a></span></h1>
|
||||
</span><a id='src-10302' class='srclink' href='../src/clap/macros.rs.html#84-118'>[src]</a></span></h1>
|
||||
<pre class='rust macro'>
|
||||
<span class='macro'>macro_rules</span><span class='macro'>!</span> <span class='ident'>value_t</span> {
|
||||
(<span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>m</span>:<span class='ident'>ident</span>.<span class='ident'>value_of</span>(<span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>v</span>:<span class='ident'>expr</span>), <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>t</span>:<span class='ident'>ty</span>) <span class='op'>=></span> {
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
<section id='main' class="content macro">
|
||||
<h1 class='fqn'><span class='in-band'><a href='index.html'>clap</a>::<wbr><a class='macro' href=''>value_t_or_exit!</a></span><span class='out-of-band'><span id='render-detail'>
|
||||
<a id="collapse-all" href="#">[-]</a> <a id="expand-all" href="#">[+]</a>
|
||||
</span><a id='src-10182' class='srclink' href='../src/clap/macros.rs.html#166-216'>[src]</a></span></h1>
|
||||
</span><a id='src-10303' class='srclink' href='../src/clap/macros.rs.html#166-216'>[src]</a></span></h1>
|
||||
<pre class='rust macro'>
|
||||
<span class='macro'>macro_rules</span><span class='macro'>!</span> <span class='ident'>value_t_or_exit</span> {
|
||||
(<span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>m</span>:<span class='ident'>ident</span>.<span class='ident'>value_of</span>(<span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>v</span>:<span class='ident'>expr</span>), <span class='macro-nonterminal'>$</span><span class='macro-nonterminal'>t</span>:<span class='ident'>ty</span>) <span class='op'>=></span> {
|
||||
|
|
|
@ -43,8 +43,8 @@
|
|||
<section id='main' class="content struct">
|
||||
<h1 class='fqn'><span class='in-band'>Struct <a href='index.html'>clap</a>::<wbr><a class='struct' href=''>App</a></span><span class='out-of-band'><span id='render-detail'>
|
||||
<a id="collapse-all" href="#">[-]</a> <a id="expand-all" href="#">[+]</a>
|
||||
</span><a id='src-31' class='srclink' href='../src/clap/app.rs.html#41-72'>[src]</a></span></h1>
|
||||
<pre class='rust struct'>pub struct App<'a, 'v, 'ab, 'u, 'ar> {
|
||||
</span><a id='src-31' class='srclink' href='../src/clap/app.rs.html#41-74'>[src]</a></span></h1>
|
||||
<pre class='rust struct'>pub struct App<'a, 'v, 'ab, 'u, 'h, 'ar> {
|
||||
// some fields omitted
|
||||
}</pre><div class='docblock'><p>Used to create a representation of a command line program and all possible command line
|
||||
arguments for parsing at runtime.</p>
|
||||
|
@ -70,7 +70,7 @@ long as <code>.get_matches()</code> is last).</p>
|
|||
|
||||
<span class='comment'>// Your pogram logic starts here...</span>
|
||||
</pre>
|
||||
</div><h2 id='methods'>Methods</h2><h3 class='impl'><code>impl<'a, 'v, 'ab, 'u, 'ar> <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'ar></code></h3><div class='impl-items'><h4 id='method.new' class='method'><code>fn <a href='#method.new' class='fnname'>new</a><'n>(n: &'n <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -> <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'ar></code></h4>
|
||||
</div><h2 id='methods'>Methods</h2><h3 class='impl'><code>impl<'a, 'v, 'ab, 'u, 'h, 'ar> <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'h, 'ar></code></h3><div class='impl-items'><h4 id='method.new' class='method'><code>fn <a href='#method.new' class='fnname'>new</a><'n>(n: &'n <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -> <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'h, 'ar></code></h4>
|
||||
<div class='docblock'><p>Creates a new instance of an application requiring a name (such as the binary). The name
|
||||
will be displayed to the user when they request to print version or help and usage
|
||||
information. The name should not contain spaces (hyphens '-' are ok).</p>
|
||||
|
@ -79,7 +79,7 @@ information. The name should not contain spaces (hyphens '-' are ok).</p
|
|||
href="#example">Example</a></h1><pre id='rust-example-rendered' class='rust '>
|
||||
<span class='kw'>let</span> <span class='ident'>prog</span> <span class='op'>=</span> <span class='ident'>App</span>::<span class='ident'>new</span>(<span class='string'>"myprog"</span>)
|
||||
</pre>
|
||||
</div><h4 id='method.author' class='method'><code>fn <a href='#method.author' class='fnname'>author</a>(self, a: &'a <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -> <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'ar></code></h4>
|
||||
</div><h4 id='method.author' class='method'><code>fn <a href='#method.author' class='fnname'>author</a>(self, a: &'a <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -> <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'h, 'ar></code></h4>
|
||||
<div class='docblock'><p>Sets a string of author(s) and will be displayed to the user when they request the version
|
||||
or help information.</p>
|
||||
|
||||
|
@ -87,7 +87,7 @@ or help information.</p>
|
|||
href="#example">Example</a></h1><pre id='rust-example-rendered' class='rust '>
|
||||
.<span class='ident'>author</span>(<span class='string'>"Kevin <kbknapp@gmail.com>"</span>)
|
||||
</pre>
|
||||
</div><h4 id='method.about' class='method'><code>fn <a href='#method.about' class='fnname'>about</a>(self, a: &'ab <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -> <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'ar></code></h4>
|
||||
</div><h4 id='method.about' class='method'><code>fn <a href='#method.about' class='fnname'>about</a>(self, a: &'ab <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -> <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'h, 'ar></code></h4>
|
||||
<div class='docblock'><p>Sets a string briefly describing what the program does and will be displayed when
|
||||
displaying help information.</p>
|
||||
|
||||
|
@ -95,7 +95,17 @@ displaying help information.</p>
|
|||
href="#example">Example</a></h1><pre id='rust-example-rendered' class='rust '>
|
||||
.<span class='ident'>about</span>(<span class='string'>"Does really amazing things to great people"</span>)
|
||||
</pre>
|
||||
</div><h4 id='method.version' class='method'><code>fn <a href='#method.version' class='fnname'>version</a>(self, v: &'v <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -> <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'ar></code></h4>
|
||||
</div><h4 id='method.after_help' class='method'><code>fn <a href='#method.after_help' class='fnname'>after_help</a>(self, h: &'h <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -> <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'h, 'ar></code></h4>
|
||||
<div class='docblock'><p>Adds additional help information to be displayed in addition to and directly after
|
||||
auto-generated help. This information is displayed <strong>after</strong> the auto-generated help
|
||||
information. This additional help is often used to describe how to use the arguments,
|
||||
or caveats to be noted.</p>
|
||||
|
||||
<h1 id="example" class='section-header'><a
|
||||
href="#example">Example</a></h1><pre id='rust-example-rendered' class='rust '>
|
||||
.<span class='ident'>after_help</span>(<span class='string'>"Does really amazing things to great people"</span>)
|
||||
</pre>
|
||||
</div><h4 id='method.version' class='method'><code>fn <a href='#method.version' class='fnname'>version</a>(self, v: &'v <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -> <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'h, 'ar></code></h4>
|
||||
<div class='docblock'><p>Sets a string of the version number to be displayed when displaying version or help
|
||||
information.</p>
|
||||
|
||||
|
@ -103,7 +113,7 @@ information.</p>
|
|||
href="#example">Example</a></h1><pre id='rust-example-rendered' class='rust '>
|
||||
.<span class='ident'>version</span>(<span class='string'>"v0.1.24"</span>)
|
||||
</pre>
|
||||
</div><h4 id='method.usage' class='method'><code>fn <a href='#method.usage' class='fnname'>usage</a>(self, u: &'u <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -> <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'ar></code></h4>
|
||||
</div><h4 id='method.usage' class='method'><code>fn <a href='#method.usage' class='fnname'>usage</a>(self, u: &'u <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -> <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'h, 'ar></code></h4>
|
||||
<div class='docblock'><p>Sets a custom usage string to over-ride the auto-generated usage string. Will be
|
||||
displayed to the user when errors are found in argument parsing, or when you call
|
||||
<code>ArgMatches::usage()</code></p>
|
||||
|
@ -119,7 +129,7 @@ showing the usage.</p>
|
|||
href="#example">Example</a></h1><pre id='rust-example-rendered' class='rust '>
|
||||
.<span class='ident'>usage</span>(<span class='string'>"myapp [-clDas] <some_file>"</span>)
|
||||
</pre>
|
||||
</div><h4 id='method.arg' class='method'><code>fn <a href='#method.arg' class='fnname'>arg</a><'l, 'h, 'b, 'r>(self, a: <a class='struct' href='../clap/struct.Arg.html' title='clap::Arg'>Arg</a><'ar, 'ar, 'ar, 'ar, 'ar, 'ar>) -> <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'ar></code></h4>
|
||||
</div><h4 id='method.arg' class='method'><code>fn <a href='#method.arg' class='fnname'>arg</a>(self, a: <a class='struct' href='../clap/struct.Arg.html' title='clap::Arg'>Arg</a><'ar, 'ar, 'ar, 'ar, 'ar, 'ar>) -> <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'h, 'ar></code></h4>
|
||||
<div class='docblock'><p>Adds an argument to the list of valid possibilties manually. This method allows you full
|
||||
control over the arguments settings and options (as well as dynamic generation). It also
|
||||
allows you specify several more advanced configuration options such as relational rules
|
||||
|
@ -138,7 +148,7 @@ control over the advanced configuration options.</p>
|
|||
<span class='comment'>// Adding a single "option" argument with a short, a long, and help text using the less verbose Arg::from_usage()</span>
|
||||
.<span class='ident'>arg</span>(<span class='ident'>Arg</span>::<span class='ident'>from_usage</span>(<span class='string'>"-c --config=[CONFIG] 'Optionally sets a configuration file to use'"</span>))
|
||||
</pre>
|
||||
</div><h4 id='method.args' class='method'><code>fn <a href='#method.args' class='fnname'>args</a>(self, args: <a class='struct' href='http://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><<a class='struct' href='../clap/struct.Arg.html' title='clap::Arg'>Arg</a><'ar, 'ar, 'ar, 'ar, 'ar, 'ar>>) -> <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'ar></code></h4>
|
||||
</div><h4 id='method.args' class='method'><code>fn <a href='#method.args' class='fnname'>args</a>(self, args: <a class='struct' href='http://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><<a class='struct' href='../clap/struct.Arg.html' title='clap::Arg'>Arg</a><'ar, 'ar, 'ar, 'ar, 'ar, 'ar>>) -> <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'h, 'ar></code></h4>
|
||||
<div class='docblock'><p>Adds multiple arguments to the list of valid possibilties by iterating over a Vec of Args</p>
|
||||
|
||||
<h1 id="example" class='section-header'><a
|
||||
|
@ -146,7 +156,7 @@ control over the advanced configuration options.</p>
|
|||
.<span class='ident'>args</span>( <span class='macro'>vec</span><span class='macro'>!</span>[<span class='ident'>Arg</span>::<span class='ident'>from_usage</span>(<span class='string'>"[debug] -d 'turns on debugging info"</span>),
|
||||
<span class='ident'>Arg</span>::<span class='ident'>with_name</span>(<span class='string'>"input"</span>).<span class='ident'>index</span>(<span class='number'>1</span>).<span class='ident'>help</span>(<span class='string'>"the input file to use"</span>)])
|
||||
</pre>
|
||||
</div><h4 id='method.arg_from_usage' class='method'><code>fn <a href='#method.arg_from_usage' class='fnname'>arg_from_usage</a>(self, usage: &'ar <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -> <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'ar></code></h4>
|
||||
</div><h4 id='method.arg_from_usage' class='method'><code>fn <a href='#method.arg_from_usage' class='fnname'>arg_from_usage</a>(self, usage: &'ar <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -> <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'h, 'ar></code></h4>
|
||||
<div class='docblock'><p>A convienience method for adding a single basic argument (one without advanced relational rules)
|
||||
from a usage type string. The string used follows the same rules and syntax as <code>Arg::from_usage()</code></p>
|
||||
|
||||
|
@ -157,7 +167,7 @@ from a usage type string. The string used follows the same rules and syntax as <
|
|||
href="#example">Example</a></h1><pre id='rust-example-rendered' class='rust '>
|
||||
.<span class='ident'>arg_from_usage</span>(<span class='string'>"-c --conf=<config> 'Sets a configuration file to use'"</span>)
|
||||
</pre>
|
||||
</div><h4 id='method.args_from_usage' class='method'><code>fn <a href='#method.args_from_usage' class='fnname'>args_from_usage</a>(self, usage: &'ar <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -> <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'ar></code></h4>
|
||||
</div><h4 id='method.args_from_usage' class='method'><code>fn <a href='#method.args_from_usage' class='fnname'>args_from_usage</a>(self, usage: &'ar <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -> <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'h, 'ar></code></h4>
|
||||
<div class='docblock'><p>Adds multiple arguments at once from a usage string, one per line. See <code>Arg::from_usage()</code>
|
||||
for details on the syntax and rules supported.</p>
|
||||
|
||||
|
@ -172,7 +182,7 @@ greatly enhanced, especially if you don't need any of the more advanced conf
|
|||
[debug]... -d 'Sets the debugging level'
|
||||
<input> 'The input file to use'"</span>)
|
||||
</pre>
|
||||
</div><h4 id='method.subcommand' class='method'><code>fn <a href='#method.subcommand' class='fnname'>subcommand</a>(self, subcmd: <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'ar>) -> <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'ar></code></h4>
|
||||
</div><h4 id='method.subcommand' class='method'><code>fn <a href='#method.subcommand' class='fnname'>subcommand</a>(self, subcmd: <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'h, 'ar>) -> <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'h, 'ar></code></h4>
|
||||
<div class='docblock'><p>Adds a subcommand to the list of valid possibilties. Subcommands are effectively sub apps,
|
||||
because they can contain their own arguments, subcommands, version, usage, etc. They also
|
||||
function just like apps, in that they get their own auto generated help, version, and usage.</p>
|
||||
|
@ -184,7 +194,7 @@ function just like apps, in that they get their own auto generated help, version
|
|||
.<span class='ident'>arg_from_usage</span>(<span class='string'>"<config> 'Required configuration file to use'"</span>))
|
||||
<span class='comment'>// Additional subcommand configuration goes here, such as other arguments...</span>
|
||||
</pre>
|
||||
</div><h4 id='method.subcommands' class='method'><code>fn <a href='#method.subcommands' class='fnname'>subcommands</a>(self, subcmds: <a class='struct' href='http://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><<a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'ar>>) -> <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'ar></code></h4>
|
||||
</div><h4 id='method.subcommands' class='method'><code>fn <a href='#method.subcommands' class='fnname'>subcommands</a>(self, subcmds: <a class='struct' href='http://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><<a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'h, 'ar>>) -> <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'a, 'v, 'ab, 'u, 'h, 'ar></code></h4>
|
||||
<div class='docblock'><p>Adds multiple subcommands to the list of valid possibilties by iterating over a Vec of <code>SubCommand</code>s</p>
|
||||
|
||||
<h1 id="example" class='section-header'><a
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
<section id='main' class="content struct">
|
||||
<h1 class='fqn'><span class='in-band'>Struct <a href='index.html'>clap</a>::<wbr><a class='struct' href=''>Arg</a></span><span class='out-of-band'><span id='render-detail'>
|
||||
<a id="collapse-all" href="#">[-]</a> <a id="expand-all" href="#">[+]</a>
|
||||
</span><a id='src-8286' class='srclink' href='../src/clap/args/arg.rs.html#31-76'>[src]</a></span></h1>
|
||||
</span><a id='src-8397' class='srclink' href='../src/clap/args/arg.rs.html#31-76'>[src]</a></span></h1>
|
||||
<pre class='rust struct'>pub struct Arg<'n, 'l, 'h, 'b, 'p, 'r> {
|
||||
// some fields omitted
|
||||
}</pre><div class='docblock'><p>The abstract representation of a command line argument used by the consumer of the library.
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
<section id='main' class="content struct">
|
||||
<h1 class='fqn'><span class='in-band'>Struct <a href='index.html'>clap</a>::<wbr><a class='struct' href=''>ArgMatches</a></span><span class='out-of-band'><span id='render-detail'>
|
||||
<a id="collapse-all" href="#">[-]</a> <a id="expand-all" href="#">[+]</a>
|
||||
</span><a id='src-9142' class='srclink' href='../src/clap/args/argmatches.rs.html#55-62'>[src]</a></span></h1>
|
||||
</span><a id='src-9261' class='srclink' href='../src/clap/args/argmatches.rs.html#55-62'>[src]</a></span></h1>
|
||||
<pre class='rust struct'>pub struct ArgMatches<'a> {
|
||||
// some fields omitted
|
||||
}</pre><div class='docblock'><p>Used to get information about the arguments that where supplied to the program at runtime by
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
<section id='main' class="content struct">
|
||||
<h1 class='fqn'><span class='in-band'>Struct <a href='index.html'>clap</a>::<wbr><a class='struct' href=''>SubCommand</a></span><span class='out-of-band'><span id='render-detail'>
|
||||
<a id="collapse-all" href="#">[-]</a> <a id="expand-all" href="#">[+]</a>
|
||||
</span><a id='src-9501' class='srclink' href='../src/clap/args/subcommand.rs.html#23-26'>[src]</a></span></h1>
|
||||
</span><a id='src-9620' class='srclink' href='../src/clap/args/subcommand.rs.html#23-26'>[src]</a></span></h1>
|
||||
<pre class='rust struct'>pub struct SubCommand<'a> {
|
||||
pub name: <a class='struct' href='http://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>,
|
||||
pub matches: <a class='struct' href='../clap/struct.ArgMatches.html' title='clap::ArgMatches'>ArgMatches</a><'a>,
|
||||
|
@ -64,7 +64,7 @@ their own arguments and subcommands).</p>
|
|||
</div><h2 class='fields'>Fields</h2>
|
||||
<table><tr class='stab '>
|
||||
<td id='structfield.name'><code>name</code></td><td></td></tr><tr class='stab '>
|
||||
<td id='structfield.matches'><code>matches</code></td><td></td></tr></table><h2 id='methods'>Methods</h2><h3 class='impl'><code>impl<'a> <a class='struct' href='../clap/struct.SubCommand.html' title='clap::SubCommand'>SubCommand</a><'a></code></h3><div class='impl-items'><h4 id='method.new' class='method'><code>fn <a href='#method.new' class='fnname'>new</a><'n, 'au, 'v, 'ab, 'u, 'ar>(name: &'n <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -> <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'au, 'v, 'ab, 'u, 'ar></code></h4>
|
||||
<td id='structfield.matches'><code>matches</code></td><td></td></tr></table><h2 id='methods'>Methods</h2><h3 class='impl'><code>impl<'a> <a class='struct' href='../clap/struct.SubCommand.html' title='clap::SubCommand'>SubCommand</a><'a></code></h3><div class='impl-items'><h4 id='method.new' class='method'><code>fn <a href='#method.new' class='fnname'>new</a><'n, 'au, 'v, 'ab, 'u, 'h, 'ar>(name: &'n <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -> <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a><'au, 'v, 'ab, 'u, 'h, 'ar></code></h4>
|
||||
<div class='docblock'><p>Creates a new instance of a subcommand requiring a name. Will be displayed
|
||||
to the user when they print version or help and usage information.</p>
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1369,6 +1369,32 @@
|
|||
<span id="1327">1327</span>
|
||||
<span id="1328">1328</span>
|
||||
<span id="1329">1329</span>
|
||||
<span id="1330">1330</span>
|
||||
<span id="1331">1331</span>
|
||||
<span id="1332">1332</span>
|
||||
<span id="1333">1333</span>
|
||||
<span id="1334">1334</span>
|
||||
<span id="1335">1335</span>
|
||||
<span id="1336">1336</span>
|
||||
<span id="1337">1337</span>
|
||||
<span id="1338">1338</span>
|
||||
<span id="1339">1339</span>
|
||||
<span id="1340">1340</span>
|
||||
<span id="1341">1341</span>
|
||||
<span id="1342">1342</span>
|
||||
<span id="1343">1343</span>
|
||||
<span id="1344">1344</span>
|
||||
<span id="1345">1345</span>
|
||||
<span id="1346">1346</span>
|
||||
<span id="1347">1347</span>
|
||||
<span id="1348">1348</span>
|
||||
<span id="1349">1349</span>
|
||||
<span id="1350">1350</span>
|
||||
<span id="1351">1351</span>
|
||||
<span id="1352">1352</span>
|
||||
<span id="1353">1353</span>
|
||||
<span id="1354">1354</span>
|
||||
<span id="1355">1355</span>
|
||||
</pre><pre class='rust '>
|
||||
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>collections</span>::<span class='ident'>BTreeMap</span>;
|
||||
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>collections</span>::<span class='ident'>BTreeSet</span>;
|
||||
|
@ -1410,7 +1436,7 @@
|
|||
<span class='doccomment'>///</span>
|
||||
<span class='doccomment'>/// // Your pogram logic starts here...</span>
|
||||
<span class='doccomment'>/// ```</span>
|
||||
<span class='kw'>pub</span> <span class='kw'>struct</span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
<span class='kw'>pub</span> <span class='kw'>struct</span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'h</span>, <span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
<span class='comment'>// The name displayed to the user when showing version and help/usage information</span>
|
||||
<span class='ident'>name</span>: <span class='ident'>String</span>,
|
||||
<span class='comment'>// A string of author(s) if desired. Displayed when showing help/usage information</span>
|
||||
|
@ -1419,6 +1445,8 @@
|
|||
<span class='ident'>version</span>: <span class='prelude-ty'>Option</span><span class='op'><</span><span class='kw-2'>&</span><span class='lifetime'>'v</span> <span class='ident'>str</span><span class='op'>></span>,
|
||||
<span class='comment'>// A brief explaination of the program that gets displayed to the user when shown help/usage information</span>
|
||||
<span class='ident'>about</span>: <span class='prelude-ty'>Option</span><span class='op'><</span><span class='kw-2'>&</span><span class='lifetime'>'ab</span> <span class='ident'>str</span><span class='op'>></span>,
|
||||
<span class='comment'>// Additional help information</span>
|
||||
<span class='ident'>more_help</span>: <span class='prelude-ty'>Option</span><span class='op'><</span><span class='kw-2'>&</span><span class='lifetime'>'h</span> <span class='ident'>str</span><span class='op'>></span>,
|
||||
<span class='comment'>// A list of possible flags</span>
|
||||
<span class='ident'>flags</span>: <span class='ident'>BTreeMap</span><span class='op'><</span><span class='kw-2'>&</span><span class='lifetime'>'ar</span> <span class='ident'>str</span>, <span class='ident'>FlagBuilder</span><span class='op'><</span><span class='lifetime'>'ar</span><span class='op'>>></span>,
|
||||
<span class='comment'>// A list of possible options</span>
|
||||
|
@ -1426,7 +1454,7 @@
|
|||
<span class='comment'>// A list of positional arguments</span>
|
||||
<span class='ident'>positionals_idx</span>: <span class='ident'>BTreeMap</span><span class='op'><</span><span class='ident'>u8</span>, <span class='ident'>PosBuilder</span><span class='op'><</span><span class='lifetime'>'ar</span><span class='op'>>></span>,
|
||||
<span class='comment'>// A list of subcommands</span>
|
||||
<span class='ident'>subcommands</span>: <span class='ident'>BTreeMap</span><span class='op'><</span><span class='ident'>String</span>, <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'ar</span><span class='op'>>></span>,
|
||||
<span class='ident'>subcommands</span>: <span class='ident'>BTreeMap</span><span class='op'><</span><span class='ident'>String</span>, <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'h</span>, <span class='lifetime'>'ar</span><span class='op'>>></span>,
|
||||
<span class='ident'>needs_long_help</span>: <span class='ident'>bool</span>,
|
||||
<span class='ident'>needs_long_version</span>: <span class='ident'>bool</span>,
|
||||
<span class='ident'>needs_short_help</span>: <span class='ident'>bool</span>,
|
||||
|
@ -1443,7 +1471,7 @@
|
|||
|
||||
}
|
||||
|
||||
<span class='kw'>impl</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'ar</span><span class='op'>></span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'ar</span><span class='op'>></span>{
|
||||
<span class='kw'>impl</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'h</span>, <span class='lifetime'>'ar</span><span class='op'>></span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'h</span>, <span class='lifetime'>'ar</span><span class='op'>></span>{
|
||||
<span class='doccomment'>/// Creates a new instance of an application requiring a name (such as the binary). The name</span>
|
||||
<span class='doccomment'>/// will be displayed to the user when they request to print version or help and usage</span>
|
||||
<span class='doccomment'>/// information. The name should not contain spaces (hyphens '-' are ok).</span>
|
||||
|
@ -1456,11 +1484,12 @@
|
|||
<span class='doccomment'>/// let prog = App::new("myprog")</span>
|
||||
<span class='doccomment'>/// # .get_matches();</span>
|
||||
<span class='doccomment'>/// ```</span>
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>new</span><span class='op'><</span><span class='lifetime'>'n</span><span class='op'>></span>(<span class='ident'>n</span>: <span class='kw-2'>&</span><span class='lifetime'>'n</span> <span class='ident'>str</span>) <span class='op'>-></span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>new</span><span class='op'><</span><span class='lifetime'>'n</span><span class='op'>></span>(<span class='ident'>n</span>: <span class='kw-2'>&</span><span class='lifetime'>'n</span> <span class='ident'>str</span>) <span class='op'>-></span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'h</span>, <span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
<span class='ident'>App</span> {
|
||||
<span class='ident'>name</span>: <span class='ident'>n</span>.<span class='ident'>to_owned</span>(),
|
||||
<span class='ident'>author</span>: <span class='prelude-val'>None</span>,
|
||||
<span class='ident'>about</span>: <span class='prelude-val'>None</span>,
|
||||
<span class='ident'>more_help</span>: <span class='prelude-val'>None</span>,
|
||||
<span class='ident'>version</span>: <span class='prelude-val'>None</span>,
|
||||
<span class='ident'>flags</span>: <span class='ident'>BTreeMap</span>::<span class='ident'>new</span>(),
|
||||
<span class='ident'>opts</span>: <span class='ident'>BTreeMap</span>::<span class='ident'>new</span>(),
|
||||
|
@ -1493,7 +1522,7 @@
|
|||
<span class='doccomment'>/// .author("Kevin <kbknapp@gmail.com>")</span>
|
||||
<span class='doccomment'>/// # .get_matches();</span>
|
||||
<span class='doccomment'>/// ```</span>
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>author</span>(<span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>a</span>: <span class='kw-2'>&</span><span class='lifetime'>'a</span> <span class='ident'>str</span>) <span class='op'>-></span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>author</span>(<span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>a</span>: <span class='kw-2'>&</span><span class='lifetime'>'a</span> <span class='ident'>str</span>) <span class='op'>-></span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'h</span>, <span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
<span class='self'>self</span>.<span class='ident'>author</span> <span class='op'>=</span> <span class='prelude-val'>Some</span>(<span class='ident'>a</span>);
|
||||
<span class='self'>self</span>
|
||||
}
|
||||
|
@ -1509,11 +1538,29 @@
|
|||
<span class='doccomment'>/// .about("Does really amazing things to great people")</span>
|
||||
<span class='doccomment'>/// # .get_matches();</span>
|
||||
<span class='doccomment'>/// ```</span>
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>about</span>(<span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>a</span>: <span class='kw-2'>&</span><span class='lifetime'>'ab</span> <span class='ident'>str</span>) <span class='op'>-></span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>about</span>(<span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>a</span>: <span class='kw-2'>&</span><span class='lifetime'>'ab</span> <span class='ident'>str</span>) <span class='op'>-></span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'h</span>, <span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
<span class='self'>self</span>.<span class='ident'>about</span> <span class='op'>=</span> <span class='prelude-val'>Some</span>(<span class='ident'>a</span>);
|
||||
<span class='self'>self</span>
|
||||
}
|
||||
|
||||
<span class='doccomment'>/// Adds additional help information to be displayed in addition to and directly after</span>
|
||||
<span class='doccomment'>/// auto-generated help. This information is displayed **after** the auto-generated help</span>
|
||||
<span class='doccomment'>/// information. This additional help is often used to describe how to use the arguments,</span>
|
||||
<span class='doccomment'>/// or caveats to be noted.</span>
|
||||
<span class='doccomment'>///</span>
|
||||
<span class='doccomment'>/// # Example</span>
|
||||
<span class='doccomment'>///</span>
|
||||
<span class='doccomment'>/// ```no_run</span>
|
||||
<span class='doccomment'>/// # use clap::App;</span>
|
||||
<span class='doccomment'>/// # let app = App::new("myprog")</span>
|
||||
<span class='doccomment'>/// .after_help("Does really amazing things to great people")</span>
|
||||
<span class='doccomment'>/// # .get_matches();</span>
|
||||
<span class='doccomment'>/// ```</span>
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>after_help</span>(<span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>h</span>: <span class='kw-2'>&</span><span class='lifetime'>'h</span> <span class='ident'>str</span>) <span class='op'>-></span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'h</span>, <span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
<span class='self'>self</span>.<span class='ident'>more_help</span> <span class='op'>=</span> <span class='prelude-val'>Some</span>(<span class='ident'>h</span>);
|
||||
<span class='self'>self</span>
|
||||
}
|
||||
|
||||
<span class='doccomment'>/// Sets a string of the version number to be displayed when displaying version or help</span>
|
||||
<span class='doccomment'>/// information.</span>
|
||||
<span class='doccomment'>///</span>
|
||||
|
@ -1525,7 +1572,7 @@
|
|||
<span class='doccomment'>/// .version("v0.1.24")</span>
|
||||
<span class='doccomment'>/// # .get_matches();</span>
|
||||
<span class='doccomment'>/// ```</span>
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>version</span>(<span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>v</span>: <span class='kw-2'>&</span><span class='lifetime'>'v</span> <span class='ident'>str</span>) <span class='op'>-></span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>version</span>(<span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>v</span>: <span class='kw-2'>&</span><span class='lifetime'>'v</span> <span class='ident'>str</span>) <span class='op'>-></span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'h</span>, <span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
<span class='self'>self</span>.<span class='ident'>version</span> <span class='op'>=</span> <span class='prelude-val'>Some</span>(<span class='ident'>v</span>);
|
||||
<span class='self'>self</span>
|
||||
}
|
||||
|
@ -1550,7 +1597,7 @@
|
|||
<span class='doccomment'>/// .usage("myapp [-clDas] <some_file>")</span>
|
||||
<span class='doccomment'>/// # .get_matches();</span>
|
||||
<span class='doccomment'>/// ```</span>
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>usage</span>(<span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>u</span>: <span class='kw-2'>&</span><span class='lifetime'>'u</span> <span class='ident'>str</span>) <span class='op'>-></span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>usage</span>(<span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>u</span>: <span class='kw-2'>&</span><span class='lifetime'>'u</span> <span class='ident'>str</span>) <span class='op'>-></span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'h</span>, <span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
<span class='self'>self</span>.<span class='ident'>usage_str</span> <span class='op'>=</span> <span class='prelude-val'>Some</span>(<span class='ident'>u</span>);
|
||||
<span class='self'>self</span>
|
||||
}
|
||||
|
@ -1577,7 +1624,7 @@
|
|||
<span class='doccomment'>/// .arg(Arg::from_usage("-c --config=[CONFIG] 'Optionally sets a configuration file to use'"))</span>
|
||||
<span class='doccomment'>/// # .get_matches();</span>
|
||||
<span class='doccomment'>/// ```</span>
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>arg</span><span class='op'><</span><span class='lifetime'>'l</span>, <span class='lifetime'>'h</span>, <span class='lifetime'>'b</span>, <span class='lifetime'>'r</span><span class='op'>></span>(<span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>a</span>: <span class='ident'>Arg</span><span class='op'><</span><span class='lifetime'>'ar</span>, <span class='lifetime'>'ar</span>, <span class='lifetime'>'ar</span>, <span class='lifetime'>'ar</span>, <span class='lifetime'>'ar</span>, <span class='lifetime'>'ar</span><span class='op'>></span>) <span class='op'>-></span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>arg</span>(<span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>a</span>: <span class='ident'>Arg</span><span class='op'><</span><span class='lifetime'>'ar</span>, <span class='lifetime'>'ar</span>, <span class='lifetime'>'ar</span>, <span class='lifetime'>'ar</span>, <span class='lifetime'>'ar</span>, <span class='lifetime'>'ar</span><span class='op'>></span>) <span class='op'>-></span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'h</span>, <span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
<span class='kw'>if</span> <span class='self'>self</span>.<span class='ident'>arg_list</span>.<span class='ident'>contains</span>(<span class='ident'>a</span>.<span class='ident'>name</span>) {
|
||||
<span class='macro'>panic</span><span class='macro'>!</span>(<span class='string'>"Argument name must be unique, \"{}\" is already in use"</span>, <span class='ident'>a</span>.<span class='ident'>name</span>);
|
||||
} <span class='kw'>else</span> {
|
||||
|
@ -1750,7 +1797,7 @@
|
|||
<span class='doccomment'>/// Arg::with_name("input").index(1).help("the input file to use")])</span>
|
||||
<span class='doccomment'>/// # .get_matches();</span>
|
||||
<span class='doccomment'>/// ```</span>
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>args</span>(<span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>args</span>: <span class='ident'>Vec</span><span class='op'><</span><span class='ident'>Arg</span><span class='op'><</span><span class='lifetime'>'ar</span>, <span class='lifetime'>'ar</span>, <span class='lifetime'>'ar</span>, <span class='lifetime'>'ar</span>, <span class='lifetime'>'ar</span>, <span class='lifetime'>'ar</span><span class='op'>>></span>) <span class='op'>-></span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>args</span>(<span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>args</span>: <span class='ident'>Vec</span><span class='op'><</span><span class='ident'>Arg</span><span class='op'><</span><span class='lifetime'>'ar</span>, <span class='lifetime'>'ar</span>, <span class='lifetime'>'ar</span>, <span class='lifetime'>'ar</span>, <span class='lifetime'>'ar</span>, <span class='lifetime'>'ar</span><span class='op'>>></span>) <span class='op'>-></span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'h</span>, <span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
<span class='kw'>for</span> <span class='ident'>arg</span> <span class='kw'>in</span> <span class='ident'>args</span>.<span class='ident'>into_iter</span>() {
|
||||
<span class='self'>self</span> <span class='op'>=</span> <span class='self'>self</span>.<span class='ident'>arg</span>(<span class='ident'>arg</span>);
|
||||
}
|
||||
|
@ -1772,7 +1819,7 @@
|
|||
<span class='doccomment'>/// .arg_from_usage("-c --conf=<config> 'Sets a configuration file to use'")</span>
|
||||
<span class='doccomment'>/// # .get_matches();</span>
|
||||
<span class='doccomment'>/// ```</span>
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>arg_from_usage</span>(<span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>usage</span>: <span class='kw-2'>&</span><span class='lifetime'>'ar</span> <span class='ident'>str</span>) <span class='op'>-></span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>arg_from_usage</span>(<span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>usage</span>: <span class='kw-2'>&</span><span class='lifetime'>'ar</span> <span class='ident'>str</span>) <span class='op'>-></span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'h</span>, <span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
<span class='self'>self</span> <span class='op'>=</span> <span class='self'>self</span>.<span class='ident'>arg</span>(<span class='ident'>Arg</span>::<span class='ident'>from_usage</span>(<span class='ident'>usage</span>));
|
||||
<span class='self'>self</span>
|
||||
}
|
||||
|
@ -1796,7 +1843,7 @@
|
|||
<span class='doccomment'>/// <input> 'The input file to use'")</span>
|
||||
<span class='doccomment'>/// # .get_matches();</span>
|
||||
<span class='doccomment'>/// ```</span>
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>args_from_usage</span>(<span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>usage</span>: <span class='kw-2'>&</span><span class='lifetime'>'ar</span> <span class='ident'>str</span>) <span class='op'>-></span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>args_from_usage</span>(<span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>usage</span>: <span class='kw-2'>&</span><span class='lifetime'>'ar</span> <span class='ident'>str</span>) <span class='op'>-></span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'h</span>, <span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
<span class='kw'>for</span> <span class='ident'>l</span> <span class='kw'>in</span> <span class='ident'>usage</span>.<span class='ident'>lines</span>() {
|
||||
<span class='self'>self</span> <span class='op'>=</span> <span class='self'>self</span>.<span class='ident'>arg</span>(<span class='ident'>Arg</span>::<span class='ident'>from_usage</span>(<span class='ident'>l</span>.<span class='ident'>trim</span>()));
|
||||
}
|
||||
|
@ -1820,7 +1867,7 @@
|
|||
<span class='doccomment'>/// // Additional subcommand configuration goes here, such as other arguments...</span>
|
||||
<span class='doccomment'>/// # .get_matches();</span>
|
||||
<span class='doccomment'>/// ```</span>
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>subcommand</span>(<span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>subcmd</span>: <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'ar</span><span class='op'>></span>) <span class='op'>-></span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>subcommand</span>(<span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>subcmd</span>: <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'h</span>, <span class='lifetime'>'ar</span><span class='op'>></span>) <span class='op'>-></span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'h</span>, <span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
<span class='kw'>if</span> <span class='ident'>subcmd</span>.<span class='ident'>name</span> <span class='op'>==</span> <span class='string'>"help"</span> { <span class='self'>self</span>.<span class='ident'>needs_subcmd_help</span> <span class='op'>=</span> <span class='boolval'>false</span>; }
|
||||
<span class='self'>self</span>.<span class='ident'>subcommands</span>.<span class='ident'>insert</span>(<span class='ident'>subcmd</span>.<span class='ident'>name</span>.<span class='ident'>clone</span>(), <span class='ident'>subcmd</span>);
|
||||
<span class='self'>self</span>
|
||||
|
@ -1839,7 +1886,7 @@
|
|||
<span class='doccomment'>/// SubCommand::new("debug").about("Controls debug functionality")])</span>
|
||||
<span class='doccomment'>/// # .get_matches();</span>
|
||||
<span class='doccomment'>/// ```</span>
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>subcommands</span>(<span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>subcmds</span>: <span class='ident'>Vec</span><span class='op'><</span><span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'ar</span><span class='op'>>></span>) <span class='op'>-></span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>subcommands</span>(<span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>subcmds</span>: <span class='ident'>Vec</span><span class='op'><</span><span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'h</span>, <span class='lifetime'>'ar</span><span class='op'>>></span>) <span class='op'>-></span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'h</span>, <span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
<span class='kw'>for</span> <span class='ident'>subcmd</span> <span class='kw'>in</span> <span class='ident'>subcmds</span>.<span class='ident'>into_iter</span>() {
|
||||
<span class='self'>self</span> <span class='op'>=</span> <span class='self'>self</span>.<span class='ident'>subcommand</span>(<span class='ident'>subcmd</span>);
|
||||
}
|
||||
|
@ -2067,6 +2114,11 @@
|
|||
}
|
||||
}
|
||||
|
||||
<span class='kw'>if</span> <span class='kw'>let</span> <span class='prelude-val'>Some</span>(<span class='ident'>h</span>) <span class='op'>=</span> <span class='self'>self</span>.<span class='ident'>more_help</span> {
|
||||
<span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>""</span>);
|
||||
<span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>"{}"</span>, <span class='ident'>h</span>);
|
||||
}
|
||||
|
||||
<span class='self'>self</span>.<span class='ident'>exit</span>(<span class='number'>0</span>);
|
||||
}
|
||||
|
||||
|
|
|
@ -582,6 +582,16 @@
|
|||
<span id="540">540</span>
|
||||
<span id="541">541</span>
|
||||
<span id="542">542</span>
|
||||
<span id="543">543</span>
|
||||
<span id="544">544</span>
|
||||
<span id="545">545</span>
|
||||
<span id="546">546</span>
|
||||
<span id="547">547</span>
|
||||
<span id="548">548</span>
|
||||
<span id="549">549</span>
|
||||
<span id="550">550</span>
|
||||
<span id="551">551</span>
|
||||
<span id="552">552</span>
|
||||
</pre><pre class='rust '>
|
||||
<span class='kw'>use</span> <span class='ident'>usageparser</span>::{<span class='ident'>UsageParser</span>, <span class='ident'>UsageToken</span>};
|
||||
|
||||
|
@ -796,21 +806,31 @@
|
|||
<span class='ident'>UsageToken</span>::<span class='ident'>Name</span>(<span class='ident'>n</span>, <span class='ident'>req</span>) <span class='op'>=></span> {
|
||||
<span class='kw'>if</span> <span class='ident'>name</span>.<span class='ident'>is_none</span>() {
|
||||
<span class='ident'>name</span> <span class='op'>=</span> <span class='prelude-val'>Some</span>(<span class='ident'>n</span>);
|
||||
<span class='kw'>if</span> <span class='kw'>let</span> <span class='prelude-val'>Some</span>(<span class='ident'>m</span>) <span class='op'>=</span> <span class='ident'>req</span> {
|
||||
<span class='ident'>required</span> <span class='op'>=</span> <span class='ident'>m</span>;
|
||||
<span class='kw'>if</span> <span class='kw'>let</span> <span class='prelude-val'>Some</span>(<span class='ident'>r</span>) <span class='op'>=</span> <span class='ident'>req</span> {
|
||||
<span class='ident'>required</span> <span class='op'>=</span> <span class='ident'>r</span>;
|
||||
}
|
||||
}
|
||||
} <span class='kw'>else</span> <span class='kw'>if</span> <span class='kw'>let</span> <span class='prelude-val'>Some</span>(<span class='ident'>l</span>) <span class='op'>=</span> <span class='ident'>long</span> {
|
||||
<span class='kw'>if</span> <span class='ident'>l</span> <span class='op'>==</span> <span class='ident'>name</span>.<span class='ident'>unwrap</span>() {
|
||||
<span class='kw'>if</span> <span class='kw'>let</span> <span class='prelude-val'>Some</span>(<span class='ident'>r</span>) <span class='op'>=</span> <span class='ident'>req</span> {
|
||||
<span class='ident'>required</span> <span class='op'>=</span> <span class='ident'>r</span>;
|
||||
}
|
||||
<span class='ident'>name</span> <span class='op'>=</span> <span class='prelude-val'>Some</span>(<span class='ident'>n</span>);
|
||||
} <span class='kw'>else</span> <span class='kw'>if</span> <span class='ident'>n</span> <span class='op'>!=</span> <span class='ident'>l</span> {
|
||||
<span class='ident'>name</span> <span class='op'>=</span> <span class='prelude-val'>Some</span>(<span class='ident'>n</span>);
|
||||
}
|
||||
|
||||
}
|
||||
<span class='kw'>if</span> <span class='ident'>short</span>.<span class='ident'>is_some</span>() <span class='op'>||</span> <span class='ident'>long</span>.<span class='ident'>is_some</span>() {
|
||||
<span class='ident'>takes_value</span> <span class='op'>=</span> <span class='boolval'>true</span>;
|
||||
}
|
||||
<span class='kw'>if</span> <span class='kw'>let</span> <span class='prelude-val'>Some</span>(<span class='ident'>l</span>) <span class='op'>=</span> <span class='ident'>long</span> {
|
||||
<span class='kw'>if</span> <span class='ident'>n</span> <span class='op'>!=</span> <span class='ident'>name</span>.<span class='ident'>unwrap</span>() <span class='op'>&&</span> <span class='ident'>name</span>.<span class='ident'>unwrap</span>() <span class='op'>==</span> <span class='ident'>l</span> {
|
||||
<span class='ident'>name</span> <span class='op'>=</span> <span class='prelude-val'>Some</span>(<span class='ident'>n</span>);
|
||||
<span class='kw'>if</span> <span class='kw'>let</span> <span class='prelude-val'>Some</span>(<span class='ident'>m</span>) <span class='op'>=</span> <span class='ident'>req</span> {
|
||||
<span class='ident'>required</span> <span class='op'>=</span> <span class='ident'>m</span>;
|
||||
}
|
||||
}
|
||||
}
|
||||
<span class='comment'>// if let Some(l) = long {</span>
|
||||
<span class='comment'>// if n != name.unwrap() && name.unwrap() == l {</span>
|
||||
<span class='comment'>// name = Some(n);</span>
|
||||
<span class='comment'>// if let Some(r) = req {</span>
|
||||
<span class='comment'>// required = r;</span>
|
||||
<span class='comment'>// }</span>
|
||||
<span class='comment'>// }</span>
|
||||
<span class='comment'>// } </span>
|
||||
},
|
||||
<span class='ident'>UsageToken</span>::<span class='ident'>Short</span>(<span class='ident'>s</span>) <span class='op'>=></span> {
|
||||
<span class='ident'>short</span> <span class='op'>=</span> <span class='prelude-val'>Some</span>(<span class='ident'>s</span>);
|
||||
|
|
|
@ -123,7 +123,7 @@
|
|||
<span class='doccomment'>/// SubCommand::new("config")</span>
|
||||
<span class='doccomment'>/// # ).get_matches();</span>
|
||||
<span class='doccomment'>/// ```</span>
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>new</span><span class='op'><</span><span class='lifetime'>'n</span>, <span class='lifetime'>'au</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'ar</span><span class='op'>></span>(<span class='ident'>name</span>: <span class='kw-2'>&</span><span class='lifetime'>'n</span> <span class='ident'>str</span>) <span class='op'>-></span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'au</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>new</span><span class='op'><</span><span class='lifetime'>'n</span>, <span class='lifetime'>'au</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'h</span>, <span class='lifetime'>'ar</span><span class='op'>></span>(<span class='ident'>name</span>: <span class='kw-2'>&</span><span class='lifetime'>'n</span> <span class='ident'>str</span>) <span class='op'>-></span> <span class='ident'>App</span><span class='op'><</span><span class='lifetime'>'au</span>, <span class='lifetime'>'v</span>, <span class='lifetime'>'ab</span>, <span class='lifetime'>'u</span>, <span class='lifetime'>'h</span>, <span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
<span class='ident'>App</span>::<span class='ident'>new</span>(<span class='ident'>name</span>)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -980,7 +980,7 @@
|
|||
<span class='comment'>// DOCS</span>
|
||||
<span class='doccomment'>//! # clap</span>
|
||||
<span class='doccomment'>//! </span>
|
||||
<span class='doccomment'>//! ![Travis-CI](https://travis-ci.org/kbknapp/clap-rs.svg?branch=master) [![](http://meritbadge.herokuapp.com/clap)](https://crates.io/crates/clap) [![Join the chat at https://gitter.im/kbknapp/clap-rs](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/kbknapp/clap-rs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)</span>
|
||||
<span class='doccomment'>//! ![Travis-CI](https://travis-ci.org/kbknapp/clap-rs.svg?branch=master) [![Crates.io](https://img.shields.io/crates/v/clap.svg)]() [![Crates.io](https://img.shields.io/crates/l/clap.svg)]() [![Join the chat at https://gitter.im/kbknapp/clap-rs](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/kbknapp/clap-rs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)</span>
|
||||
<span class='doccomment'>//! </span>
|
||||
<span class='doccomment'>//! Command Line Argument Parser for Rust</span>
|
||||
<span class='doccomment'>//! </span>
|
||||
|
@ -1718,7 +1718,7 @@
|
|||
|
||||
<span class='kw'>let</span> <span class='ident'>b</span> <span class='op'>=</span> <span class='ident'>Arg</span>::<span class='ident'>from_usage</span>(<span class='string'>"-o --opt [option] 'some help info'"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>b</span>.<span class='ident'>name</span>, <span class='string'>"option"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>a</span>.<span class='ident'>long</span>.<span class='ident'>unwrap</span>(), <span class='string'>"opt"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>b</span>.<span class='ident'>long</span>.<span class='ident'>unwrap</span>(), <span class='string'>"opt"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>b</span>.<span class='ident'>short</span>.<span class='ident'>unwrap</span>(), <span class='string'>'o'</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>b</span>.<span class='ident'>help</span>.<span class='ident'>unwrap</span>(), <span class='string'>"some help info"</span>);
|
||||
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='op'>!</span><span class='ident'>b</span>.<span class='ident'>multiple</span>);
|
||||
|
@ -1727,8 +1727,8 @@
|
|||
|
||||
<span class='kw'>let</span> <span class='ident'>c</span> <span class='op'>=</span> <span class='ident'>Arg</span>::<span class='ident'>from_usage</span>(<span class='string'>"<option> -o --opt <opt> 'some help info'"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c</span>.<span class='ident'>name</span>, <span class='string'>"option"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>a</span>.<span class='ident'>long</span>.<span class='ident'>unwrap</span>(), <span class='string'>"opt"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>a</span>.<span class='ident'>short</span>.<span class='ident'>unwrap</span>(), <span class='string'>'o'</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c</span>.<span class='ident'>long</span>.<span class='ident'>unwrap</span>(), <span class='string'>"opt"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c</span>.<span class='ident'>short</span>.<span class='ident'>unwrap</span>(), <span class='string'>'o'</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c</span>.<span class='ident'>help</span>.<span class='ident'>unwrap</span>(), <span class='string'>"some help info"</span>);
|
||||
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='op'>!</span><span class='ident'>c</span>.<span class='ident'>multiple</span>);
|
||||
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>c</span>.<span class='ident'>takes_value</span>);
|
||||
|
@ -1736,8 +1736,8 @@
|
|||
|
||||
<span class='kw'>let</span> <span class='ident'>d</span> <span class='op'>=</span> <span class='ident'>Arg</span>::<span class='ident'>from_usage</span>(<span class='string'>"-o --opt <option> 'some help info'"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>d</span>.<span class='ident'>name</span>, <span class='string'>"option"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>a</span>.<span class='ident'>long</span>.<span class='ident'>unwrap</span>(), <span class='string'>"opt"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>a</span>.<span class='ident'>short</span>.<span class='ident'>unwrap</span>(), <span class='string'>'o'</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>d</span>.<span class='ident'>long</span>.<span class='ident'>unwrap</span>(), <span class='string'>"opt"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>d</span>.<span class='ident'>short</span>.<span class='ident'>unwrap</span>(), <span class='string'>'o'</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>d</span>.<span class='ident'>help</span>.<span class='ident'>unwrap</span>(), <span class='string'>"some help info"</span>);
|
||||
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='op'>!</span><span class='ident'>d</span>.<span class='ident'>multiple</span>);
|
||||
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>d</span>.<span class='ident'>takes_value</span>);
|
||||
|
@ -1754,7 +1754,7 @@
|
|||
|
||||
<span class='kw'>let</span> <span class='ident'>b</span> <span class='op'>=</span> <span class='ident'>Arg</span>::<span class='ident'>from_usage</span>(<span class='string'>"-o --opt [option]... 'some help info'"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>b</span>.<span class='ident'>name</span>, <span class='string'>"option"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>a</span>.<span class='ident'>long</span>.<span class='ident'>unwrap</span>(), <span class='string'>"opt"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>b</span>.<span class='ident'>long</span>.<span class='ident'>unwrap</span>(), <span class='string'>"opt"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>b</span>.<span class='ident'>short</span>.<span class='ident'>unwrap</span>(), <span class='string'>'o'</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>b</span>.<span class='ident'>help</span>.<span class='ident'>unwrap</span>(), <span class='string'>"some help info"</span>);
|
||||
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>b</span>.<span class='ident'>multiple</span>);
|
||||
|
@ -1763,8 +1763,8 @@
|
|||
|
||||
<span class='kw'>let</span> <span class='ident'>c</span> <span class='op'>=</span> <span class='ident'>Arg</span>::<span class='ident'>from_usage</span>(<span class='string'>"<option>... -o --opt <opt> 'some help info'"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c</span>.<span class='ident'>name</span>, <span class='string'>"option"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>a</span>.<span class='ident'>long</span>.<span class='ident'>unwrap</span>(), <span class='string'>"opt"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>a</span>.<span class='ident'>short</span>.<span class='ident'>unwrap</span>(), <span class='string'>'o'</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c</span>.<span class='ident'>long</span>.<span class='ident'>unwrap</span>(), <span class='string'>"opt"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c</span>.<span class='ident'>short</span>.<span class='ident'>unwrap</span>(), <span class='string'>'o'</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c</span>.<span class='ident'>help</span>.<span class='ident'>unwrap</span>(), <span class='string'>"some help info"</span>);
|
||||
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>c</span>.<span class='ident'>multiple</span>);
|
||||
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>c</span>.<span class='ident'>takes_value</span>);
|
||||
|
@ -1772,8 +1772,8 @@
|
|||
|
||||
<span class='kw'>let</span> <span class='ident'>d</span> <span class='op'>=</span> <span class='ident'>Arg</span>::<span class='ident'>from_usage</span>(<span class='string'>"-o --opt <option>... 'some help info'"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>d</span>.<span class='ident'>name</span>, <span class='string'>"option"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>a</span>.<span class='ident'>long</span>.<span class='ident'>unwrap</span>(), <span class='string'>"opt"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>a</span>.<span class='ident'>short</span>.<span class='ident'>unwrap</span>(), <span class='string'>'o'</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>d</span>.<span class='ident'>long</span>.<span class='ident'>unwrap</span>(), <span class='string'>"opt"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>d</span>.<span class='ident'>short</span>.<span class='ident'>unwrap</span>(), <span class='string'>'o'</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>d</span>.<span class='ident'>help</span>.<span class='ident'>unwrap</span>(), <span class='string'>"some help info"</span>);
|
||||
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>d</span>.<span class='ident'>multiple</span>);
|
||||
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>d</span>.<span class='ident'>takes_value</span>);
|
||||
|
@ -1792,7 +1792,7 @@
|
|||
|
||||
<span class='kw'>let</span> <span class='ident'>b</span> <span class='op'>=</span> <span class='ident'>Arg</span>::<span class='ident'>from_usage</span>(<span class='string'>"-o --opt=[option] 'some help info'"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>b</span>.<span class='ident'>name</span>, <span class='string'>"option"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>a</span>.<span class='ident'>long</span>.<span class='ident'>unwrap</span>(), <span class='string'>"opt"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>b</span>.<span class='ident'>long</span>.<span class='ident'>unwrap</span>(), <span class='string'>"opt"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>b</span>.<span class='ident'>short</span>.<span class='ident'>unwrap</span>(), <span class='string'>'o'</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>b</span>.<span class='ident'>help</span>.<span class='ident'>unwrap</span>(), <span class='string'>"some help info"</span>);
|
||||
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='op'>!</span><span class='ident'>b</span>.<span class='ident'>multiple</span>);
|
||||
|
@ -1801,8 +1801,8 @@
|
|||
|
||||
<span class='kw'>let</span> <span class='ident'>c</span> <span class='op'>=</span> <span class='ident'>Arg</span>::<span class='ident'>from_usage</span>(<span class='string'>"<option> -o --opt=<opt> 'some help info'"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c</span>.<span class='ident'>name</span>, <span class='string'>"option"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>a</span>.<span class='ident'>long</span>.<span class='ident'>unwrap</span>(), <span class='string'>"opt"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>a</span>.<span class='ident'>short</span>.<span class='ident'>unwrap</span>(), <span class='string'>'o'</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c</span>.<span class='ident'>long</span>.<span class='ident'>unwrap</span>(), <span class='string'>"opt"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c</span>.<span class='ident'>short</span>.<span class='ident'>unwrap</span>(), <span class='string'>'o'</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c</span>.<span class='ident'>help</span>.<span class='ident'>unwrap</span>(), <span class='string'>"some help info"</span>);
|
||||
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='op'>!</span><span class='ident'>c</span>.<span class='ident'>multiple</span>);
|
||||
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>c</span>.<span class='ident'>takes_value</span>);
|
||||
|
@ -1810,8 +1810,8 @@
|
|||
|
||||
<span class='kw'>let</span> <span class='ident'>d</span> <span class='op'>=</span> <span class='ident'>Arg</span>::<span class='ident'>from_usage</span>(<span class='string'>"-o --opt=<option> 'some help info'"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>d</span>.<span class='ident'>name</span>, <span class='string'>"option"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>a</span>.<span class='ident'>long</span>.<span class='ident'>unwrap</span>(), <span class='string'>"opt"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>a</span>.<span class='ident'>short</span>.<span class='ident'>unwrap</span>(), <span class='string'>'o'</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>d</span>.<span class='ident'>long</span>.<span class='ident'>unwrap</span>(), <span class='string'>"opt"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>d</span>.<span class='ident'>short</span>.<span class='ident'>unwrap</span>(), <span class='string'>'o'</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>d</span>.<span class='ident'>help</span>.<span class='ident'>unwrap</span>(), <span class='string'>"some help info"</span>);
|
||||
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='op'>!</span><span class='ident'>d</span>.<span class='ident'>multiple</span>);
|
||||
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>d</span>.<span class='ident'>takes_value</span>);
|
||||
|
@ -1828,7 +1828,7 @@
|
|||
|
||||
<span class='kw'>let</span> <span class='ident'>b</span> <span class='op'>=</span> <span class='ident'>Arg</span>::<span class='ident'>from_usage</span>(<span class='string'>"-o --opt=[option]... 'some help info'"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>b</span>.<span class='ident'>name</span>, <span class='string'>"option"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>a</span>.<span class='ident'>long</span>.<span class='ident'>unwrap</span>(), <span class='string'>"opt"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>b</span>.<span class='ident'>long</span>.<span class='ident'>unwrap</span>(), <span class='string'>"opt"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>b</span>.<span class='ident'>short</span>.<span class='ident'>unwrap</span>(), <span class='string'>'o'</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>b</span>.<span class='ident'>help</span>.<span class='ident'>unwrap</span>(), <span class='string'>"some help info"</span>);
|
||||
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>b</span>.<span class='ident'>multiple</span>);
|
||||
|
@ -1837,8 +1837,8 @@
|
|||
|
||||
<span class='kw'>let</span> <span class='ident'>c</span> <span class='op'>=</span> <span class='ident'>Arg</span>::<span class='ident'>from_usage</span>(<span class='string'>"<option>... -o --opt=<opt> 'some help info'"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c</span>.<span class='ident'>name</span>, <span class='string'>"option"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>a</span>.<span class='ident'>long</span>.<span class='ident'>unwrap</span>(), <span class='string'>"opt"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>a</span>.<span class='ident'>short</span>.<span class='ident'>unwrap</span>(), <span class='string'>'o'</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c</span>.<span class='ident'>long</span>.<span class='ident'>unwrap</span>(), <span class='string'>"opt"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c</span>.<span class='ident'>short</span>.<span class='ident'>unwrap</span>(), <span class='string'>'o'</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>c</span>.<span class='ident'>help</span>.<span class='ident'>unwrap</span>(), <span class='string'>"some help info"</span>);
|
||||
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>c</span>.<span class='ident'>multiple</span>);
|
||||
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>c</span>.<span class='ident'>takes_value</span>);
|
||||
|
@ -1846,8 +1846,8 @@
|
|||
|
||||
<span class='kw'>let</span> <span class='ident'>d</span> <span class='op'>=</span> <span class='ident'>Arg</span>::<span class='ident'>from_usage</span>(<span class='string'>"-o --opt=<option>... 'some help info'"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>d</span>.<span class='ident'>name</span>, <span class='string'>"option"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>a</span>.<span class='ident'>long</span>.<span class='ident'>unwrap</span>(), <span class='string'>"opt"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>a</span>.<span class='ident'>short</span>.<span class='ident'>unwrap</span>(), <span class='string'>'o'</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>d</span>.<span class='ident'>long</span>.<span class='ident'>unwrap</span>(), <span class='string'>"opt"</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>d</span>.<span class='ident'>short</span>.<span class='ident'>unwrap</span>(), <span class='string'>'o'</span>);
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>d</span>.<span class='ident'>help</span>.<span class='ident'>unwrap</span>(), <span class='string'>"some help info"</span>);
|
||||
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>d</span>.<span class='ident'>multiple</span>);
|
||||
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>d</span>.<span class='ident'>takes_value</span>);
|
||||
|
|
Loading…
Reference in a new issue