Skip to content

Commit

Permalink
docs(clap): rebuild documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kbknapp committed Apr 1, 2015
1 parent cdc32eb commit fb3ccd7
Show file tree
Hide file tree
Showing 8 changed files with 186 additions and 50 deletions.
10 changes: 5 additions & 5 deletions docs/clap/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ <h1 id="clap" class='section-header'><a

<p>Command Line Argument Parser written in Rust</p>

<p>A simply library for parsing command line arguments and subcommands when writing command line and console applications.</p>
<p>It is a simple to use and efficient library for parsing command line arguments and subcommands when writing command line, console, or terminal applications.</p>

<p>You can use <code>clap</code> to lay out a list of possible valid command line arguments and subcommands, then let <code>clap</code> parse the string given by the user at runtime.</p>
<p>You can use clap to lay out a list of possible valid command line arguments and subcommands, then let <code>clap</code> parse <em>and validate</em> the string given by the user at runtime. This means you focus on your applications functionality, not parsing and validating arguments.</p>

<p>When using <code>clap</code> you define a set of parameters and rules for your arguments and subcommands, then at runtime <code>clap</code> will determine their validity.</p>
<p>What seperates <code>clap</code> from other options available is the very simple almost &#39;Pythonic&#39; style in which you define the valid available arguments for your program. This means you don&#39;t have to spend tons time learning an entirely new library&#39;s structures and use.</p>

<p><code>clap</code> also provides the traditional version and help switches &#39;for free&#39; by parsing the list of possible valid arguments lazily at runtime, and if not already defined by the developer <code>clap</code> will autogenerate all applicable &quot;help&quot; and &quot;version&quot; switches (as well as a &quot;help&quot; subcommand if other subcommands are defined as well).</p>
<p><code>clap</code> also provides all the traditional version and help switches (or flags) &#39;for free&#39; by parsing the list of developer supplied arguments. If the developer hasn&#39;t defined them already, <code>clap</code> will auto-generate only the applicable &quot;help&quot; and &quot;version&quot; switches (as well as a &quot;help&quot; subcommand so long as other subcommands have been manually defined as well).</p>

<p>After defining a list of possible valid arguments and subcommands, <code>clap</code> gives you a list of valid matches that the user supplied at runtime, or informs the user of their error and exits gracefully. You can use this list to determine the functioning of your program.</p>
<p>After defining a list of possible valid arguments and subcommands, <code>clap</code> parses the string given by the end-user at runtime then gives you a list of the valid matches and their values. If the user made an error or typo, <code>clap</code> informs them and exits gracefully. This means that you can simply use these matches and values to determine the functioning of your program.</p>

<h2 id="quick-example" class='section-header'><a
href="#quick-example">Quick Example</a></h2><pre id='rust-example-rendered' class='rust '>
Expand Down
2 changes: 1 addition & 1 deletion docs/clap/struct.Arg.html
Original file line number Diff line number Diff line change
Expand Up @@ -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><wbr></span><span class='out-of-band'><span id='render-detail'>
<a id="collapse-all" href="#">[-]</a>&nbsp;<a id="expand-all" href="#">[+]</a>
</span><a id='src-7025' href='../src/clap/args/arg.rs.html#21-55'>[src]</a></span></h1>
</span><a id='src-7315' href='../src/clap/args/arg.rs.html#21-55'>[src]</a></span></h1>
<pre class='rust struct'>pub struct Arg&lt;'n, 'l, 'h, 'b, 'p, 'r&gt; {
pub name: &amp;'n <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>,
pub short: <a class='enum' href='http://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a href='http://doc.rust-lang.org/nightly/std/primitive.char.html'>char</a>&gt;,
Expand Down
16 changes: 7 additions & 9 deletions docs/clap/struct.ArgMatches.html
Original file line number Diff line number Diff line change
Expand Up @@ -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><wbr></span><span class='out-of-band'><span id='render-detail'>
<a id="collapse-all" href="#">[-]</a>&nbsp;<a id="expand-all" href="#">[+]</a>
</span><a id='src-7606' href='../src/clap/args/argmatches.rs.html#62-68'>[src]</a></span></h1>
</span><a id='src-7896' href='../src/clap/args/argmatches.rs.html#62-68'>[src]</a></span></h1>
<pre class='rust struct'>pub struct ArgMatches&lt;'a&gt; {
pub flags: <a class='struct' href='http://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html' title='std::collections::hash::map::HashMap'>HashMap</a>&lt;&amp;'a <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>, FlagArg&gt;,
pub opts: <a class='struct' href='http://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html' title='std::collections::hash::map::HashMap'>HashMap</a>&lt;&amp;'a <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>, OptArg&gt;,
Expand Down Expand Up @@ -108,8 +108,8 @@ <h1 id="example" class='section-header'><a
an additional value at runtime). If the option wasn&#39;t present at runtime
it returns <code>None</code>. </p>

<p><em>NOTE:</em> If getting a value for an option argument that allows multiples, prefer <code>values_of()</code>
as <code>value_of()</code> will only return the <em><em>first</em></em> value.</p>
<p><em>NOTE:</em> If getting a value for an option or positional argument that allows multiples,
prefer <code>values_of()</code> as <code>value_of()</code> will only return the <em><em>first</em></em> value.</p>

<h1 id="example" class='section-header'><a
href="#example">Example</a></h1><pre id='rust-example-rendered' class='rust '>
Expand All @@ -118,9 +118,9 @@ <h1 id="example" class='section-header'><a
}
</pre>
</div><h4 id='method.values_of' class='method'><a class='stability Unmarked' title='No stability level'></a><code>fn <a href='#method.values_of' class='fnname'>values_of</a>&lt;'n&gt;(&amp;self, name: &amp;'n <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -&gt; <a class='enum' href='http://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='struct' href='http://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a>&lt;&amp;<a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>&gt;&gt;</code></h4>
<div class='docblock'><p>Gets the values of a specific option in a vector (i.e. an argument that takes
an additional value at runtime). If the option wasn&#39;t present at runtime
it returns <code>None</code></p>
<div class='docblock'><p>Gets the values of a specific option or positional argument in a vector (i.e. an argument
that takes an additional value at runtime). If the option wasn&#39;t present at runtime it
returns <code>None</code></p>

<h1 id="example" class='section-header'><a
href="#example">Example</a></h1><pre id='rust-example-rendered' class='rust '>
Expand All @@ -144,13 +144,11 @@ <h1 id="example" class='section-header'><a
}
</pre>
</div><h4 id='method.occurrences_of' class='method'><a class='stability Unmarked' title='No stability level'></a><code>fn <a href='#method.occurrences_of' class='fnname'>occurrences_of</a>&lt;'n&gt;(&amp;self, name: &amp;'n <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -&gt; <a href='http://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a></code></h4>
<div class='docblock'><p>Checks the number of occurrences of an option or flag at runtime.
<div class='docblock'><p>Checks the number of occurrences of an option, flag, or positional argument at runtime.
If an option or flag isn&#39;t present it will return <code>0</code>, if the option or flag doesn&#39;t
allow multiple occurrences, it will return <code>1</code> no matter how many times it occurred
(unless it wasn&#39;t prsent) at all.</p>

<p><em>NOTE:</em> This <em><em>DOES NOT</em></em> work for positional arguments (use <code>.value_of()</code> instead). </p>

<h1 id="example" class='section-header'><a
href="#example">Example</a></h1><pre id='rust-example-rendered' class='rust '>
<span class='kw'>if</span> <span class='ident'>matches</span>.<span class='ident'>occurrences_of</span>(<span class='string'>&quot;debug&quot;</span>) <span class='op'>&gt;</span> <span class='number'>1</span> {
Expand Down
2 changes: 1 addition & 1 deletion docs/clap/struct.SubCommand.html
Original file line number Diff line number Diff line change
Expand Up @@ -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><wbr></span><span class='out-of-band'><span id='render-detail'>
<a id="collapse-all" href="#">[-]</a>&nbsp;<a id="expand-all" href="#">[+]</a>
</span><a id='src-7968' href='../src/clap/args/subcommand.rs.html#23-26'>[src]</a></span></h1>
</span><a id='src-8320' href='../src/clap/args/subcommand.rs.html#23-26'>[src]</a></span></h1>
<pre class='rust struct'>pub struct SubCommand&lt;'a&gt; {
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>&lt;'a&gt;,
Expand Down
2 changes: 1 addition & 1 deletion docs/search-index.js

Large diffs are not rendered by default.

Loading

0 comments on commit fb3ccd7

Please sign in to comment.