mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 14:22:34 +00:00
chore(docs): rebuild documentation
This commit is contained in:
parent
6dc80fde3f
commit
f39004a26d
7 changed files with 12 additions and 20 deletions
|
@ -43,7 +43,7 @@
|
|||
<section id='main' class="content mod">
|
||||
<h1 class='fqn'><span class='in-band'>Crate <a class='mod' href=''>clap</a><wbr></span><span class='out-of-band'><a href='stability.html'>[stability]</a> <span id='render-detail'>
|
||||
<a id="collapse-all" href="#">[-]</a> <a id="expand-all" href="#">[+]</a>
|
||||
</span><a id='src-0' href='../src/clap/lib.rs.html#1-327'>[src]</a></span></h1>
|
||||
</span><a id='src-0' href='../src/clap/lib.rs.html#1-323'>[src]</a></span></h1>
|
||||
<div class='docblock'>
|
||||
<h1 id="clap" class='section-header'><a
|
||||
href="#clap">clap</a></h1>
|
||||
|
|
|
@ -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=''>App</a><wbr></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-33' href='../src/clap/app.rs.html#39-66'>[src]</a></span></h1>
|
||||
</span><a id='src-32' href='../src/clap/app.rs.html#38-65'>[src]</a></span></h1>
|
||||
<pre class='rust struct'>pub struct App<'a, 'v, 'ab, 'u, 'ar> {
|
||||
// some fields omitted
|
||||
}</pre><div class='docblock'><p>Used to create a representation of the program and all possible command line arguments
|
||||
|
|
|
@ -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> <a id="expand-all" href="#">[+]</a>
|
||||
</span><a id='src-8174' href='../src/clap/args/arg.rs.html#21-55'>[src]</a></span></h1>
|
||||
</span><a id='src-8173' href='../src/clap/args/arg.rs.html#21-55'>[src]</a></span></h1>
|
||||
<pre class='rust struct'>pub struct Arg<'n, 'l, 'h, 'b, 'p, 'r> {
|
||||
pub name: &'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><<a href='http://doc.rust-lang.org/nightly/std/primitive.char.html'>char</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=''>ArgMatches</a><wbr></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-8755' href='../src/clap/args/argmatches.rs.html#62-68'>[src]</a></span></h1>
|
||||
</span><a id='src-8754' href='../src/clap/args/argmatches.rs.html#62-68'>[src]</a></span></h1>
|
||||
<pre class='rust struct'>pub struct ArgMatches<'a> {
|
||||
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><&'a <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>, FlagArg>,
|
||||
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><&'a <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>, OptArg>,
|
||||
|
|
|
@ -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> <a id="expand-all" href="#">[+]</a>
|
||||
</span><a id='src-9179' href='../src/clap/args/subcommand.rs.html#23-26'>[src]</a></span></h1>
|
||||
</span><a id='src-9178' 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>,
|
||||
|
|
|
@ -1280,8 +1280,6 @@
|
|||
<span id="1238">1238</span>
|
||||
<span id="1239">1239</span>
|
||||
</pre><pre class='rust '>
|
||||
<span class='kw'>extern</span> <span class='kw'>crate</span> <span class='ident'>libc</span>;
|
||||
|
||||
<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'>HashMap</span>;
|
||||
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>collections</span>::<span class='ident'>HashSet</span>;
|
||||
|
@ -1289,6 +1287,7 @@
|
|||
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>path</span>::<span class='ident'>Path</span>;
|
||||
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>vec</span>::<span class='ident'>IntoIter</span>;
|
||||
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>borrow</span>::<span class='ident'>ToOwned</span>;
|
||||
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>process</span>;
|
||||
|
||||
<span class='kw'>use</span> <span class='ident'>args</span>::{ <span class='ident'>ArgMatches</span>, <span class='ident'>Arg</span>, <span class='ident'>SubCommand</span> };
|
||||
<span class='kw'>use</span> <span class='ident'>args</span>::{<span class='ident'>FlagArg</span>, <span class='ident'>FlagBuilder</span>};
|
||||
|
@ -1901,7 +1900,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
<span class='self'>self</span>.<span class='ident'>exit</span>();
|
||||
<span class='self'>self</span>.<span class='ident'>exit</span>(<span class='number'>0</span>);
|
||||
}
|
||||
|
||||
<span class='attribute'>#[<span class='ident'>inline</span>(<span class='ident'>always</span>)]</span>
|
||||
|
@ -1939,17 +1938,18 @@
|
|||
<span class='comment'>// Print the binary name if existing, but replace all spaces with hyphens in case we're</span>
|
||||
<span class='comment'>// dealing with subcommands i.e. git mv is translated to git-mv</span>
|
||||
<span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>"{} {}"</span>, <span class='kw-2'>&</span><span class='self'>self</span>.<span class='ident'>bin_name</span>.<span class='ident'>clone</span>().<span class='ident'>unwrap_or</span>(<span class='self'>self</span>.<span class='ident'>name</span>.<span class='ident'>clone</span>())[..].<span class='ident'>replace</span>(<span class='string'>" "</span>, <span class='string'>"-"</span>), <span class='self'>self</span>.<span class='ident'>version</span>.<span class='ident'>unwrap_or</span>(<span class='string'>""</span>) );
|
||||
<span class='kw'>if</span> <span class='ident'>quit</span> { <span class='self'>self</span>.<span class='ident'>exit</span>(); }
|
||||
<span class='kw'>if</span> <span class='ident'>quit</span> { <span class='self'>self</span>.<span class='ident'>exit</span>(<span class='number'>0</span>); }
|
||||
}
|
||||
|
||||
<span class='kw'>fn</span> <span class='ident'>exit</span>(<span class='kw-2'>&</span><span class='self'>self</span>) {
|
||||
<span class='kw'>unsafe</span> { <span class='ident'>libc</span>::<span class='ident'>exit</span>(<span class='number'>0</span>); }
|
||||
<span class='kw'>fn</span> <span class='ident'>exit</span>(<span class='kw-2'>&</span><span class='self'>self</span>, <span class='ident'>status</span>: <span class='ident'>i32</span>) {
|
||||
<span class='ident'>process</span>::<span class='ident'>exit</span>(<span class='ident'>status</span>);
|
||||
<span class='comment'>// unsafe { libc::exit(0); }</span>
|
||||
}
|
||||
|
||||
<span class='kw'>fn</span> <span class='ident'>report_error</span>(<span class='kw-2'>&</span><span class='self'>self</span>, <span class='ident'>msg</span>: <span class='ident'>String</span>, <span class='ident'>usage</span>: <span class='ident'>bool</span>, <span class='ident'>quit</span>: <span class='ident'>bool</span>) {
|
||||
<span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>"{}"</span>, <span class='ident'>msg</span>);
|
||||
<span class='kw'>if</span> <span class='ident'>usage</span> { <span class='self'>self</span>.<span class='ident'>print_usage</span>(<span class='boolval'>true</span>); }
|
||||
<span class='kw'>if</span> <span class='ident'>quit</span> { <span class='ident'>env</span>::<span class='ident'>set_exit_status</span>(<span class='number'>1</span>); <span class='self'>self</span>.<span class='ident'>exit</span>(); }
|
||||
<span class='kw'>if</span> <span class='ident'>quit</span> { <span class='self'>self</span>.<span class='ident'>exit</span>(<span class='number'>1</span>); }
|
||||
}
|
||||
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>get_matches</span>(<span class='kw-2'>mut</span> <span class='self'>self</span>) <span class='op'>-></span> <span class='ident'>ArgMatches</span><span class='op'><</span><span class='lifetime'>'ar</span><span class='op'>></span> {
|
||||
|
|
|
@ -363,15 +363,9 @@
|
|||
<span id="321">321</span>
|
||||
<span id="322">322</span>
|
||||
<span id="323">323</span>
|
||||
<span id="324">324</span>
|
||||
<span id="325">325</span>
|
||||
<span id="326">326</span>
|
||||
<span id="327">327</span>
|
||||
</pre><pre class='rust '>
|
||||
<span class='attribute'>#<span class='op'>!</span>[<span class='ident'>crate_type</span><span class='op'>=</span> <span class='string'>"lib"</span>]</span>
|
||||
|
||||
<span class='attribute'>#<span class='op'>!</span>[<span class='ident'>feature</span>(<span class='ident'>exit_status</span>)]</span>
|
||||
|
||||
<span class='comment'>// DOCS</span>
|
||||
<span class='doccomment'>//! # clap</span>
|
||||
<span class='doccomment'>//! </span>
|
||||
|
@ -584,8 +578,6 @@
|
|||
<span class='doccomment'>//! * `panic!` on *developer* error, exit gracefully on *end-user* error</span>
|
||||
<span class='doccomment'>//! </span>
|
||||
|
||||
<span class='kw'>extern</span> <span class='kw'>crate</span> <span class='ident'>libc</span>;
|
||||
|
||||
<span class='kw'>pub</span> <span class='kw'>use</span> <span class='ident'>args</span>::{<span class='ident'>Arg</span>, <span class='ident'>SubCommand</span>, <span class='ident'>ArgMatches</span>};
|
||||
<span class='kw'>pub</span> <span class='kw'>use</span> <span class='ident'>app</span>::<span class='ident'>App</span>;
|
||||
|
||||
|
|
Loading…
Reference in a new issue