version bump and rebuilt docs

This commit is contained in:
Kevin K 2015-03-24 14:35:47 -04:00
parent c7f22728f1
commit b047104d9a
9 changed files with 215 additions and 9 deletions

View file

@ -1,3 +1,5 @@
# v0.4.15
* Changed libc to crates.io in prep for Rust 1.0 stability
# v0.4.14
* Changed App version, about, name, author, and usage to allow lifetimes other than 'static
# v0.4.13

View file

@ -1,7 +1,7 @@
[package]
name = "clap"
version = "0.4.14"
version = "0.4.15"
authors = ["Kevin K. <kbknapp@gmail.com>"]
exclude = ["docs/*", "examples/*", "claptests/*"]
description = "A Command Line Argument Parser written in Rust"
@ -12,3 +12,6 @@ readme = "README.md"
keywords = ["argument", "command", "arg", "parser", "parse"]
license = "MIT"
[dependencies]
libc = "*"

View file

@ -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>&nbsp;<a id="expand-all" href="#">[+]</a>
</span><a id='src-0' href='../src/clap/lib.rs.html#1-159'>[src]</a></span></h1>
</span><a id='src-0' href='../src/clap/lib.rs.html#1-259'>[src]</a></span></h1>
<div class='docblock'>
<h1 id="clap" class='section-header'><a
href="#clap">clap</a></h1>

View file

@ -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>&nbsp;<a id="expand-all" href="#">[+]</a>
</span><a id='src-31' href='../src/clap/app.rs.html#38-64'>[src]</a></span></h1>
</span><a id='src-32' href='../src/clap/app.rs.html#38-64'>[src]</a></span></h1>
<pre class='rust struct'>pub struct App&lt;'a, 'v, 'ab, 'u&gt; {
// some fields omitted
}</pre><div class='docblock'><p>Used to create a representation of the program and all possible command line arguments

View file

@ -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-5699' href='../src/clap/args/arg.rs.html#21-53'>[src]</a></span></h1>
</span><a id='src-5700' href='../src/clap/args/arg.rs.html#21-53'>[src]</a></span></h1>
<pre class='rust struct'>pub struct Arg {
pub name: &amp;'static <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;,

View file

@ -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-6144' href='../src/clap/args/argmatches.rs.html#62-68'>[src]</a></span></h1>
</span><a id='src-6145' href='../src/clap/args/argmatches.rs.html#62-68'>[src]</a></span></h1>
<pre class='rust struct'>pub struct ArgMatches {
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;'static <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;'static <a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>, OptArg&gt;,

View file

@ -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-6496' href='../src/clap/args/subcommand.rs.html#23-26'>[src]</a></span></h1>
</span><a id='src-6497' href='../src/clap/args/subcommand.rs.html#23-26'>[src]</a></span></h1>
<pre class='rust struct'>pub struct SubCommand {
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>,

View file

@ -199,10 +199,109 @@
<span id="157">157</span>
<span id="158">158</span>
<span id="159">159</span>
<span id="160">160</span>
<span id="161">161</span>
<span id="162">162</span>
<span id="163">163</span>
<span id="164">164</span>
<span id="165">165</span>
<span id="166">166</span>
<span id="167">167</span>
<span id="168">168</span>
<span id="169">169</span>
<span id="170">170</span>
<span id="171">171</span>
<span id="172">172</span>
<span id="173">173</span>
<span id="174">174</span>
<span id="175">175</span>
<span id="176">176</span>
<span id="177">177</span>
<span id="178">178</span>
<span id="179">179</span>
<span id="180">180</span>
<span id="181">181</span>
<span id="182">182</span>
<span id="183">183</span>
<span id="184">184</span>
<span id="185">185</span>
<span id="186">186</span>
<span id="187">187</span>
<span id="188">188</span>
<span id="189">189</span>
<span id="190">190</span>
<span id="191">191</span>
<span id="192">192</span>
<span id="193">193</span>
<span id="194">194</span>
<span id="195">195</span>
<span id="196">196</span>
<span id="197">197</span>
<span id="198">198</span>
<span id="199">199</span>
<span id="200">200</span>
<span id="201">201</span>
<span id="202">202</span>
<span id="203">203</span>
<span id="204">204</span>
<span id="205">205</span>
<span id="206">206</span>
<span id="207">207</span>
<span id="208">208</span>
<span id="209">209</span>
<span id="210">210</span>
<span id="211">211</span>
<span id="212">212</span>
<span id="213">213</span>
<span id="214">214</span>
<span id="215">215</span>
<span id="216">216</span>
<span id="217">217</span>
<span id="218">218</span>
<span id="219">219</span>
<span id="220">220</span>
<span id="221">221</span>
<span id="222">222</span>
<span id="223">223</span>
<span id="224">224</span>
<span id="225">225</span>
<span id="226">226</span>
<span id="227">227</span>
<span id="228">228</span>
<span id="229">229</span>
<span id="230">230</span>
<span id="231">231</span>
<span id="232">232</span>
<span id="233">233</span>
<span id="234">234</span>
<span id="235">235</span>
<span id="236">236</span>
<span id="237">237</span>
<span id="238">238</span>
<span id="239">239</span>
<span id="240">240</span>
<span id="241">241</span>
<span id="242">242</span>
<span id="243">243</span>
<span id="244">244</span>
<span id="245">245</span>
<span id="246">246</span>
<span id="247">247</span>
<span id="248">248</span>
<span id="249">249</span>
<span id="250">250</span>
<span id="251">251</span>
<span id="252">252</span>
<span id="253">253</span>
<span id="254">254</span>
<span id="255">255</span>
<span id="256">256</span>
<span id="257">257</span>
<span id="258">258</span>
<span id="259">259</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'>&quot;lib&quot;</span>]</span>
<span class='attribute'>#<span class='op'>!</span>[<span class='ident'>feature</span>(<span class='ident'>libc</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>
@ -349,6 +448,8 @@
<span class='doccomment'>//! make doc</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>;
@ -357,7 +458,106 @@
<span class='attribute'>#[<span class='ident'>cfg</span>(<span class='ident'>test</span>)]</span>
<span class='kw'>mod</span> <span class='ident'>tests</span> {
<span class='kw'>use</span> <span class='ident'>super</span>::<span class='op'>*</span>;
<span class='kw'>use</span> <span class='ident'>super</span>::{<span class='ident'>App</span>, <span class='ident'>Arg</span>, <span class='ident'>SubCommand</span>};
<span class='attribute'>#[<span class='ident'>test</span>]</span>
<span class='kw'>fn</span> <span class='ident'>create_app</span>() {
<span class='kw'>let</span> _ <span class='op'>=</span> <span class='ident'>App</span>::<span class='ident'>new</span>(<span class='string'>&quot;test&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&quot;</span>).<span class='ident'>about</span>(<span class='string'>&quot;does awesome things&quot;</span>).<span class='ident'>get_matches</span>();
}
<span class='attribute'>#[<span class='ident'>test</span>]</span>
<span class='kw'>fn</span> <span class='ident'>add_multiple_arg</span>() {
<span class='kw'>let</span> _ <span class='op'>=</span> <span class='ident'>App</span>::<span class='ident'>new</span>(<span class='string'>&quot;test&quot;</span>)
.<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;test&quot;</span>).<span class='ident'>short</span>(<span class='string'>&quot;s&quot;</span>),
<span class='ident'>Arg</span>::<span class='ident'>new</span>(<span class='string'>&quot;test2&quot;</span>).<span class='ident'>short</span>(<span class='string'>&quot;l&quot;</span>)])
.<span class='ident'>get_matches</span>();
}
<span class='attribute'>#[<span class='ident'>test</span>]</span>
<span class='kw'>fn</span> <span class='ident'>create_flag</span>() {
<span class='kw'>let</span> _ <span class='op'>=</span> <span class='ident'>App</span>::<span class='ident'>new</span>(<span class='string'>&quot;test&quot;</span>)
.<span class='ident'>arg</span>(<span class='ident'>Arg</span>::<span class='ident'>new</span>(<span class='string'>&quot;test&quot;</span>)
.<span class='ident'>short</span>(<span class='string'>&quot;t&quot;</span>)
.<span class='ident'>long</span>(<span class='string'>&quot;test&quot;</span>)
.<span class='ident'>help</span>(<span class='string'>&quot;testing testing&quot;</span>))
.<span class='ident'>get_matches</span>();
}
<span class='attribute'>#[<span class='ident'>test</span>]</span>
<span class='kw'>fn</span> <span class='ident'>create_positional</span>() {
<span class='kw'>let</span> _ <span class='op'>=</span> <span class='ident'>App</span>::<span class='ident'>new</span>(<span class='string'>&quot;test&quot;</span>)
.<span class='ident'>arg</span>(<span class='ident'>Arg</span>::<span class='ident'>new</span>(<span class='string'>&quot;test&quot;</span>)
.<span class='ident'>index</span>(<span class='number'>1</span>)
.<span class='ident'>help</span>(<span class='string'>&quot;testing testing&quot;</span>))
.<span class='ident'>get_matches</span>();
}
<span class='attribute'>#[<span class='ident'>test</span>]</span>
<span class='kw'>fn</span> <span class='ident'>create_option</span>() {
<span class='kw'>let</span> _ <span class='op'>=</span> <span class='ident'>App</span>::<span class='ident'>new</span>(<span class='string'>&quot;test&quot;</span>)
.<span class='ident'>arg</span>(<span class='ident'>Arg</span>::<span class='ident'>new</span>(<span class='string'>&quot;test&quot;</span>)
.<span class='ident'>short</span>(<span class='string'>&quot;t&quot;</span>)
.<span class='ident'>long</span>(<span class='string'>&quot;test&quot;</span>)
.<span class='ident'>takes_value</span>(<span class='boolval'>true</span>)
.<span class='ident'>help</span>(<span class='string'>&quot;testing testing&quot;</span>))
.<span class='ident'>get_matches</span>();
}
<span class='attribute'>#[<span class='ident'>test</span>]</span>
<span class='kw'>fn</span> <span class='ident'>create_subcommand</span>() {
<span class='kw'>let</span> _ <span class='op'>=</span> <span class='ident'>App</span>::<span class='ident'>new</span>(<span class='string'>&quot;test&quot;</span>)
.<span class='ident'>subcommand</span>(<span class='ident'>SubCommand</span>::<span class='ident'>new</span>(<span class='string'>&quot;some&quot;</span>)
.<span class='ident'>arg</span>(<span class='ident'>Arg</span>::<span class='ident'>new</span>(<span class='string'>&quot;test&quot;</span>)
.<span class='ident'>short</span>(<span class='string'>&quot;t&quot;</span>)
.<span class='ident'>long</span>(<span class='string'>&quot;test&quot;</span>)
.<span class='ident'>takes_value</span>(<span class='boolval'>true</span>)
.<span class='ident'>help</span>(<span class='string'>&quot;testing testing&quot;</span>)))
.<span class='ident'>arg</span>(<span class='ident'>Arg</span>::<span class='ident'>new</span>(<span class='string'>&quot;other&quot;</span>).<span class='ident'>long</span>(<span class='string'>&quot;other&quot;</span>))
.<span class='ident'>get_matches</span>();
}
<span class='attribute'>#[<span class='ident'>test</span>]</span>
<span class='kw'>fn</span> <span class='ident'>create_multiple_subcommands</span>() {
<span class='kw'>let</span> _ <span class='op'>=</span> <span class='ident'>App</span>::<span class='ident'>new</span>(<span class='string'>&quot;test&quot;</span>)
.<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;some&quot;</span>)
.<span class='ident'>arg</span>(<span class='ident'>Arg</span>::<span class='ident'>new</span>(<span class='string'>&quot;test&quot;</span>)
.<span class='ident'>short</span>(<span class='string'>&quot;t&quot;</span>)
.<span class='ident'>long</span>(<span class='string'>&quot;test&quot;</span>)
.<span class='ident'>takes_value</span>(<span class='boolval'>true</span>)
.<span class='ident'>help</span>(<span class='string'>&quot;testing testing&quot;</span>)),
<span class='ident'>SubCommand</span>::<span class='ident'>new</span>(<span class='string'>&quot;add&quot;</span>)
.<span class='ident'>arg</span>(<span class='ident'>Arg</span>::<span class='ident'>new</span>(<span class='string'>&quot;roster&quot;</span>).<span class='ident'>short</span>(<span class='string'>&quot;r&quot;</span>))])
.<span class='ident'>arg</span>(<span class='ident'>Arg</span>::<span class='ident'>new</span>(<span class='string'>&quot;other&quot;</span>).<span class='ident'>long</span>(<span class='string'>&quot;other&quot;</span>))
.<span class='ident'>get_matches</span>();
}
<span class='attribute'>#[<span class='ident'>test</span>]</span>
<span class='attribute'>#[<span class='ident'>should_panic</span>]</span>
<span class='kw'>fn</span> <span class='ident'>unique_arg_names</span>(){
<span class='ident'>App</span>::<span class='ident'>new</span>(<span class='string'>&quot;some&quot;</span>).<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;arg&quot;</span>).<span class='ident'>short</span>(<span class='string'>&quot;a&quot;</span>),
<span class='ident'>Arg</span>::<span class='ident'>new</span>(<span class='string'>&quot;arg&quot;</span>).<span class='ident'>short</span>(<span class='string'>&quot;b&quot;</span>)
]);
}
<span class='attribute'>#[<span class='ident'>test</span>]</span>
<span class='attribute'>#[<span class='ident'>should_panic</span>]</span>
<span class='kw'>fn</span> <span class='ident'>unique_arg_shorts</span>(){
<span class='ident'>App</span>::<span class='ident'>new</span>(<span class='string'>&quot;some&quot;</span>).<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;arg1&quot;</span>).<span class='ident'>short</span>(<span class='string'>&quot;a&quot;</span>),
<span class='ident'>Arg</span>::<span class='ident'>new</span>(<span class='string'>&quot;arg2&quot;</span>).<span class='ident'>short</span>(<span class='string'>&quot;a&quot;</span>)
]);
}
<span class='attribute'>#[<span class='ident'>test</span>]</span>
<span class='attribute'>#[<span class='ident'>should_panic</span>]</span>
<span class='kw'>fn</span> <span class='ident'>unique_arg_longs</span>(){
<span class='ident'>App</span>::<span class='ident'>new</span>(<span class='string'>&quot;some&quot;</span>).<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;arg1&quot;</span>).<span class='ident'>long</span>(<span class='string'>&quot;long&quot;</span>),
<span class='ident'>Arg</span>::<span class='ident'>new</span>(<span class='string'>&quot;arg2&quot;</span>).<span class='ident'>long</span>(<span class='string'>&quot;long&quot;</span>)
]);
}
}
</pre>
</section>

View file

@ -1,10 +1,11 @@
#![crate_type= "lib"]
#![feature(libc)]
#![feature(exit_status)]
// DOCS
extern crate libc;
pub use args::{Arg, SubCommand, ArgMatches};
pub use app::App;