Rebuild docs after tab->space change

This commit is contained in:
Kevin K 2015-03-16 14:48:25 -04:00
parent 20de5b339e
commit bc94d11b03
12 changed files with 1297 additions and 1297 deletions

View file

@ -45,23 +45,23 @@
<a id="collapse-all" href="#">[-]</a>&nbsp;<a id="expand-all" href="#">[+]</a>
</span><a id='src-0' href='../src/clap/lib.rs.html#1-155'>[src]</a></span></h1>
<div class='docblock'><p>A simply library for parsing command line arguments when writing
command line and console applications.</p>
command line and console applications.</p>
<p>You can use <code>clap</code> to lay out a list of possible valid command line arguments and let <code>clap</code> parse the string given by the user at runtime.
When using <code>clap</code> you define a set of parameters and rules for your arguments and at runtime <code>clap</code> will determine their validity.
Also, <code>clap</code> provides the traditional version and help switches &#39;for free&#39; by parsing the list of possible valid arguments lazily at runtime.
i.e. only when it&#39;s been determined that the user wants or needs to see the help and version information.</p>
When using <code>clap</code> you define a set of parameters and rules for your arguments and at runtime <code>clap</code> will determine their validity.
Also, <code>clap</code> provides the traditional version and help switches &#39;for free&#39; by parsing the list of possible valid arguments lazily at runtime.
i.e. only when it&#39;s been determined that the user wants or needs to see the help and version information.</p>
<p>After defining a list of possible valid arguments you get a list of matches that the user supplied at runtime. You can then use this list to
determine the functioning of your program.</p>
determine the functioning of your program.</p>
<p># Example</p>
<pre id='rust-example-rendered' class='rust '>
<span class='kw'>use</span> <span class='ident'>clap</span>::{<span class='ident'>Arg</span>, <span class='ident'>App</span>, <span class='ident'>SubCommand</span>};
<h1 id="example" class='section-header'><a
href="#example">Example</a></h1><pre id='rust-example-rendered' class='rust '>
<span class='kw'>use</span> <span class='ident'>clap</span>::{<span class='ident'>Arg</span>, <span class='ident'>App</span>, <span class='ident'>SubCommand</span>};
<span class='comment'>// ...</span>
<span class='comment'>// ...</span>
<span class='kw'>let</span> <span class='ident'>matches</span> <span class='op'>=</span> <span class='ident'>App</span>::<span class='ident'>new</span>(<span class='string'>&quot;MyApp&quot;</span>)
<span class='kw'>let</span> <span class='ident'>matches</span> <span class='op'>=</span> <span class='ident'>App</span>::<span class='ident'>new</span>(<span class='string'>&quot;MyApp&quot;</span>)
.<span class='ident'>version</span>(<span class='string'>&quot;1.0&quot;</span>)
.<span class='ident'>author</span>(<span class='string'>&quot;Kevin K. &lt;kbknapp@gmail.com&gt;&quot;</span>)
.<span class='ident'>about</span>(<span class='string'>&quot;Does awesome things&quot;</span>)
@ -92,14 +92,14 @@
<span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>&quot;Value for config: {}&quot;</span>, <span class='ident'>c</span>);
}
<span class='kw'>match</span> <span class='ident'>matches</span>.<span class='ident'>occurrences_of</span>(<span class='string'>&quot;debug&quot;</span>) {
<span class='kw'>match</span> <span class='ident'>matches</span>.<span class='ident'>occurrences_of</span>(<span class='string'>&quot;debug&quot;</span>) {
<span class='number'>0</span> <span class='op'>=&gt;</span> <span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>&quot;Debug mode is off&quot;</span>),
<span class='number'>1</span> <span class='op'>=&gt;</span> <span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>&quot;Debug mode is kind of on&quot;</span>),
<span class='number'>2</span> <span class='op'>=&gt;</span> <span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>&quot;Debug mode is on&quot;</span>),
<span class='number'>3</span> <span class='op'>|</span> _ <span class='op'>=&gt;</span> <span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>&quot;Don&#39;t be crazy&quot;</span>),
}
}
<span class='kw'>if</span> <span class='kw'>let</span> <span class='prelude-val'>Some</span>(<span class='kw-2'>ref</span> <span class='ident'>matches</span>) <span class='op'>=</span> <span class='ident'>matches</span>.<span class='ident'>subcommand_matches</span>(<span class='string'>&quot;test&quot;</span>) {
<span class='kw'>if</span> <span class='kw'>let</span> <span class='prelude-val'>Some</span>(<span class='kw-2'>ref</span> <span class='ident'>matches</span>) <span class='op'>=</span> <span class='ident'>matches</span>.<span class='ident'>subcommand_matches</span>(<span class='string'>&quot;test&quot;</span>) {
<span class='kw'>if</span> <span class='ident'>matches</span>.<span class='ident'>is_present</span>(<span class='string'>&quot;verbose&quot;</span>) {
<span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>&quot;Printing verbose test info...&quot;</span>);
} <span class='kw'>else</span> {
@ -107,31 +107,31 @@
}
}
<span class='comment'>// more porgram logic goes here...</span>
<span class='comment'>// more porgram logic goes here...</span>
</pre>
<p>If you were to compile the above program and run it with the flag <code>--help</code> or <code>-h</code> the following output woud be presented</p>
<pre><code class="language-sh"> $ myprog --help
MyApp 1.0
Kevin K. &lt;kbknapp@gmail.com&gt;
Does awesome things
<pre><code class="language-sh">$ myprog --help
MyApp 1.0
Kevin K. &lt;kbknapp@gmail.com&gt;
Does awesome things
USAGE:
USAGE:
MyApp [FLAGS] [OPTIONS] [POSITIONAL] [SUBCOMMANDS]
FLAGS:
FLAGS:
-d Turn debugging information on
-h,--help Prints this message
-v,--version Prints version information
OPTIONS:
OPTIONS:
-c,--config &lt;config&gt; Sets a custom config file
POSITIONAL ARGUMENTS:
POSITIONAL ARGUMENTS:
output Sets an optional output file
SUBCOMMANDS:
SUBCOMMANDS:
help Prints this message
test Has test sub-functionality
</code></pre>
@ -141,7 +141,7 @@
<td><a class='stability Unmarked' title='No stability level'></a><a class='struct' href='struct.App.html'
title='clap::App'>App</a></td>
<td class='docblock short'><p>Used to create a representation of the program and all possible command line arguments
for parsing at runtime.</p>
for parsing at runtime.</p>
</td>
</tr>

View file

@ -51,14 +51,14 @@
pub about: <a class='enum' href='http://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;&amp;'static <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>&gt;,
// some fields omitted
}</pre><div class='docblock'><p>Used to create a representation of the program and all possible command line arguments
for parsing at runtime.</p>
for parsing at runtime.</p>
<p>Stores a list of all posisble arguments, as well as information displayed to the user such as
help and versioning information.</p>
help and versioning information.</p>
<p># Example</p>
<pre id='rust-example-rendered' class='rust '>
<span class='kw'>let</span> <span class='ident'>myprog</span> <span class='op'>=</span> <span class='ident'>App</span>::<span class='ident'>new</span>(<span class='string'>&quot;myprog&quot;</span>)
<h1 id="example" class='section-header'><a
href="#example">Example</a></h1><pre id='rust-example-rendered' class='rust '>
<span class='kw'>let</span> <span class='ident'>myprog</span> <span class='op'>=</span> <span class='ident'>App</span>::<span class='ident'>new</span>(<span class='string'>&quot;myprog&quot;</span>)
.<span class='ident'>author</span>(<span class='string'>&quot;Me, me@mail.com&quot;</span>)
.<span class='ident'>version</span>(<span class='string'>&quot;1.0.2&quot;</span>)
.<span class='ident'>about</span>(<span class='string'>&quot;Explains in brief what the program does&quot;</span>)
@ -68,7 +68,7 @@
)
.<span class='ident'>get_matches</span>();
<span class='comment'>// Your pogram logic starts here...</span>
<span class='comment'>// Your pogram logic starts here...</span>
</pre>
</div><h2 class='fields'>Fields</h2>
<table><tr><td id='structfield.name'><a class='stability Unmarked' title='No stability level'></a><code>name</code></td><td><div class='docblock'><p>The name displayed to the user when showing version and help/usage information</p>
@ -119,43 +119,43 @@ showing the usage.</p>
</div><h4 id='method.arg' class='method'><a class='stability Unmarked' title='No stability level'></a><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>) -&gt; <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a></code></h4>
<div class='docblock'><p>Adds an argument to the list of valid possibilties</p>
<p># Example</p>
<pre id='rust-example-rendered' class='rust '>
.<span class='ident'>arg</span>(<span class='ident'>Arg</span>::<span class='ident'>new</span>(<span class='string'>&quot;config&quot;</span>)
<h1 id="example" class='section-header'><a
href="#example">Example</a></h1><pre id='rust-example-rendered' class='rust '>
.<span class='ident'>arg</span>(<span class='ident'>Arg</span>::<span class='ident'>new</span>(<span class='string'>&quot;config&quot;</span>)
.<span class='ident'>short</span>(<span class='string'>&quot;c&quot;</span>)
<span class='comment'>// Additional argument configuration goes here...</span>
)
)
</pre>
</div><h4 id='method.args' class='method'><a class='stability Unmarked' title='No stability level'></a><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>&lt;<a class='struct' href='../clap/struct.Arg.html' title='clap::Arg'>Arg</a>&gt;) -&gt; <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a></code></h4>
<div class='docblock'><p>Adds multiple arguments to the list of valid possibilties</p>
<p># Example</p>
<pre id='rust-example-rendered' class='rust '>
.<span class='ident'>args</span>( <span class='macro'>vec</span><span class='macro'>!</span>[<span class='ident'>Arg</span>::<span class='ident'>new</span>(<span class='string'>&quot;config&quot;</span>).<span class='ident'>short</span>(<span class='string'>&quot;c&quot;</span>),
<h1 id="example" class='section-header'><a
href="#example">Example</a></h1><pre id='rust-example-rendered' class='rust '>
.<span class='ident'>args</span>( <span class='macro'>vec</span><span class='macro'>!</span>[<span class='ident'>Arg</span>::<span class='ident'>new</span>(<span class='string'>&quot;config&quot;</span>).<span class='ident'>short</span>(<span class='string'>&quot;c&quot;</span>),
<span class='ident'>Arg</span>::<span class='ident'>new</span>(<span class='string'>&quot;debug&quot;</span>).<span class='ident'>short</span>(<span class='string'>&quot;d&quot;</span>)])
</pre>
</div><h4 id='method.subcommand' class='method'><a class='stability Unmarked' title='No stability level'></a><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>) -&gt; <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a></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
and subcommands. They also function just like apps, in that they get their
own auto generated help and version switches.</p>
are effectively sub apps, because they can contain their own arguments
and subcommands. They also function just like apps, in that they get their
own auto generated help and version switches.</p>
<p># Example</p>
<pre id='rust-example-rendered' class='rust '>
.<span class='ident'>subcommand</span>(<span class='ident'>SubCommand</span>::<span class='ident'>new</span>(<span class='string'>&quot;config&quot;</span>)
<h1 id="example" class='section-header'><a
href="#example">Example</a></h1><pre id='rust-example-rendered' class='rust '>
.<span class='ident'>subcommand</span>(<span class='ident'>SubCommand</span>::<span class='ident'>new</span>(<span class='string'>&quot;config&quot;</span>)
.<span class='ident'>about</span>(<span class='string'>&quot;Controls configuration features&quot;</span>)
.<span class='ident'>arg</span>(<span class='ident'>Arg</span>::<span class='ident'>new</span>(<span class='string'>&quot;config_file&quot;</span>)
.<span class='ident'>index</span>(<span class='number'>1</span>)
.<span class='ident'>help</span>(<span class='string'>&quot;Configuration file to use&quot;</span>)))
<span class='comment'>// Additional subcommand configuration goes here, such as arguments...</span>
)
)
</pre>
</div><h4 id='method.subcommands' class='method'><a class='stability Unmarked' title='No stability level'></a><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>&lt;<a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a>&gt;) -&gt; <a class='struct' href='../clap/struct.App.html' title='clap::App'>App</a></code></h4>
<div class='docblock'><p>Adds multiple subcommands to the list of valid possibilties</p>
<p># Example</p>
<pre id='rust-example-rendered' class='rust '>
.<span class='ident'>subcommands</span>( <span class='macro'>vec</span><span class='macro'>!</span>[
<h1 id="example" class='section-header'><a
href="#example">Example</a></h1><pre id='rust-example-rendered' class='rust '>
.<span class='ident'>subcommands</span>( <span class='macro'>vec</span><span class='macro'>!</span>[
<span class='ident'>SubCommand</span>::<span class='ident'>new</span>(<span class='string'>&quot;config&quot;</span>).<span class='ident'>about</span>(<span class='string'>&quot;Controls configuration functionality&quot;</span>)
.<span class='ident'>arg</span>(<span class='ident'>Arg</span>::<span class='ident'>new</span>(<span class='string'>&quot;config_file&quot;</span>).<span class='ident'>index</span>(<span class='number'>1</span>)),
<span class='ident'>SubCommand</span>::<span class='ident'>new</span>(<span class='string'>&quot;debug&quot;</span>).<span class='ident'>about</span>(<span class='string'>&quot;Controls debug functionality&quot;</span>)])

View file

@ -170,15 +170,15 @@ arguments, they do not need to be set for each.</p>
</pre>
</div><h4 id='method.mutually_excludes_all' class='method'><a class='stability Unmarked' title='No stability level'></a><code>fn <a href='#method.mutually_excludes_all' class='fnname'>mutually_excludes_all</a>(self, names: <a class='struct' href='http://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a>&lt;&amp;'static <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>&gt;) -&gt; <a class='struct' href='../clap/struct.Arg.html' title='clap::Arg'>Arg</a></code></h4>
<div class='docblock'><p>Sets a mutually exclusive arguments by names. I.e. when using this argument,
the following argument can&#39;t be present.</p>
the following argument can&#39;t be present.</p>
<p><strong>NOTE:</strong> Mutually exclusive rules take precedence over being required
by default. Mutually exclusive rules only need to be set for one of the two
arguments, they do not need to be set for each.</p>
by default. Mutually exclusive rules only need to be set for one of the two
arguments, they do not need to be set for each.</p>
<p>Example:</p>
<pre id='rust-example-rendered' class='rust '>
.<span class='ident'>mutually_excludes_all</span>(
.<span class='ident'>mutually_excludes_all</span>(
<span class='macro'>vec</span><span class='macro'>!</span>[<span class='string'>&quot;debug&quot;</span>, <span class='string'>&quot;input&quot;</span>])
</pre>
</div><h4 id='method.requires' class='method'><a class='stability Unmarked' title='No stability level'></a><code>fn <a href='#method.requires' class='fnname'>requires</a>(self, name: &amp;'static <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -&gt; <a class='struct' href='../clap/struct.Arg.html' title='clap::Arg'>Arg</a></code></h4>
@ -193,14 +193,14 @@ using this argument, the following argument <em>must</em> be present.</p>
</pre>
</div><h4 id='method.requires_all' class='method'><a class='stability Unmarked' title='No stability level'></a><code>fn <a href='#method.requires_all' class='fnname'>requires_all</a>(self, names: <a class='struct' href='http://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a>&lt;&amp;'static <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>&gt;) -&gt; <a class='struct' href='../clap/struct.Arg.html' title='clap::Arg'>Arg</a></code></h4>
<div class='docblock'><p>Sets arguments by names that are required when this one is presnet I.e. when
using this argument, the following arguments <em>must</em> be present.</p>
using this argument, the following arguments <em>must</em> be present.</p>
<p><strong>NOTE:</strong> Mutually exclusive rules take precedence over being required
by default. </p>
by default. </p>
<p>Example:</p>
<pre id='rust-example-rendered' class='rust '>
.<span class='ident'>requires_all</span>(
.<span class='ident'>requires_all</span>(
<span class='macro'>vec</span><span class='macro'>!</span>[<span class='string'>&quot;debug&quot;</span>, <span class='string'>&quot;input&quot;</span>])
</pre>
</div><h4 id='method.takes_value' class='method'><a class='stability Unmarked' title='No stability level'></a><code>fn <a href='#method.takes_value' class='fnname'>takes_value</a>(self, tv: <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>) -&gt; <a class='struct' href='../clap/struct.Arg.html' title='clap::Arg'>Arg</a></code></h4>

View file

@ -50,12 +50,12 @@
}</pre><div class='docblock'><p>The abstract representation of a command line subcommand used by the consumer of the library.</p>
<p>This struct is used by the library consumer and describes all the valid options of the subcommand for
their program. SubCommands are treated like &quot;sub apps&quot; and contain all the same possibilities (such as
their own arguments and subcommands).</p>
their program. SubCommands are treated like &quot;sub apps&quot; and contain all the same possibilities (such as
their own arguments and subcommands).</p>
<p># Example</p>
<pre id='rust-example-rendered' class='rust '>
<span class='ident'>SubCommand</span>::<span class='ident'>new</span>(<span class='string'>&quot;conifg&quot;</span>)
<h1 id="example" class='section-header'><a
href="#example">Example</a></h1><pre id='rust-example-rendered' class='rust '>
<span class='ident'>SubCommand</span>::<span class='ident'>new</span>(<span class='string'>&quot;conifg&quot;</span>)
.<span class='ident'>about</span>(<span class='string'>&quot;Used for configuration&quot;</span>)
.<span class='ident'>arg</span>(<span class='ident'>Arg</span>::<span class='ident'>new</span>(<span class='string'>&quot;config_file&quot;</span>)
.<span class='ident'>help</span>(<span class='string'>&quot;The configuration file to use&quot;</span>)

File diff suppressed because one or more lines are too long