+ [src]
pub struct ArgMatches {
pub required: Vec<&'static str>,
pub blacklist: HashSet<&'static str>,
diff --git a/docs/src/clap/app.rs.html b/docs/src/clap/app.rs.html
index f6dd4db6..47da4fd6 100644
--- a/docs/src/clap/app.rs.html
+++ b/docs/src/clap/app.rs.html
@@ -737,6 +737,26 @@
695
696
697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
extern crate libc;
@@ -760,13 +780,15 @@
-
+
+
-
+
+
@@ -802,8 +824,10 @@
-
-
+
+
+
+
pub fn new(n: &'static str) -> App {
App {
@@ -831,8 +855,11 @@
-
-
+
+
+
+
+
pub fn author(&mut self, a: &'static str) -> &mut App {
self.author = Some(a);
@@ -843,8 +870,11 @@
-
-
+
+
+
+
+
pub fn about(&mut self, a: &'static str) -> &mut App {
self.about = Some(a);
@@ -855,8 +885,11 @@
-
-
+
+
+
+
+
pub fn version(&mut self, v: &'static str)-> &mut App {
self.version = Some(v);
@@ -867,10 +900,14 @@
-
+
+
+
-
-
+
+
+
+
pub fn arg(&mut self, a: &Arg) -> &mut App {
if self.arg_list.contains(a.name) {
@@ -968,9 +1005,12 @@
-
+
+
+
-
+
+
pub fn args(&mut self, args: Vec<&Arg>) -> &mut App {
for arg in args.iter() {
diff --git a/docs/src/clap/arg.rs.html b/docs/src/clap/arg.rs.html
index 58f6b7d4..fbf0aa86 100644
--- a/docs/src/clap/arg.rs.html
+++ b/docs/src/clap/arg.rs.html
@@ -364,6 +364,20 @@
322
323
324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
@@ -375,7 +389,8 @@
-
+
+
@@ -429,10 +444,12 @@
-
+
+
+
pub fn new(n: &'static str) -> Arg {
Arg {
@@ -461,7 +478,8 @@
-
+
+
@@ -485,7 +503,8 @@
-
+
+
@@ -501,7 +520,8 @@
-
+
+
@@ -523,7 +543,8 @@
-
+
+
@@ -543,7 +564,8 @@
-
+
+
@@ -565,7 +587,8 @@
-
+
+
@@ -588,7 +611,8 @@
-
+
+
@@ -609,7 +633,8 @@
-
+
+
@@ -632,7 +657,8 @@
-
+
+
@@ -653,7 +679,8 @@
-
+
+
@@ -676,7 +703,8 @@
-
+
+
diff --git a/docs/src/clap/argmatches.rs.html b/docs/src/clap/argmatches.rs.html
index ec09cb4c..1dd973de 100644
--- a/docs/src/clap/argmatches.rs.html
+++ b/docs/src/clap/argmatches.rs.html
@@ -190,6 +190,14 @@
148
149
150
+151
+152
+153
+154
+155
+156
+157
+158
use std::collections::HashMap;
use std::collections::HashSet;
@@ -204,7 +212,8 @@
-
+
+
@@ -213,7 +222,7 @@
-
+
@@ -256,7 +265,8 @@
-
+
+
pub fn new(app: &App) -> ArgMatches {
@@ -279,7 +289,9 @@
-
+
+
+
@@ -304,7 +316,9 @@
-
+
+
+
@@ -327,7 +341,9 @@
-
+
+
+
diff --git a/docs/src/clap/lib.rs.html b/docs/src/clap/lib.rs.html
index c34bcf7e..4f9df101 100644
--- a/docs/src/clap/lib.rs.html
+++ b/docs/src/clap/lib.rs.html
@@ -130,11 +130,10 @@
88
89
90
-91
#![crate_type= "lib"]
-#![feature(collections, core, libc, env)]
+#![feature(collections, core, libc)]
@@ -150,8 +149,7 @@
-
-
+
diff --git a/src/app.rs b/src/app.rs
index 09708bd1..31085652 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -20,13 +20,15 @@ use args::PosArg;
///
/// Example:
///
-/// ```rust.example
+/// ```no_run
+/// # use clap::{App, Arg};
/// let myprog = App::new("myprog")
/// .author("Me, me@mail.com")
/// .version("1.0.2")
/// .about("Explains in brief what the program does")
/// .arg(
-/// // Add a possible command line argument
+/// Arg::new("in_file").index(1)
+/// // Add other possible command line argument options here...
/// )
/// .get_matches();
///
@@ -62,8 +64,10 @@ impl App {
///
/// Example:
///
- /// ```rust.example
- /// let prog = App::new("myprog");
+ /// ```no_run
+ /// # use clap::{App, Arg};
+ /// let prog = App::new("myprog")
+ /// # .get_matches();
/// ```
pub fn new(n: &'static str) -> App {
App {
@@ -91,8 +95,11 @@ impl App {
///
/// Example:
///
- /// ```rust.example
- /// .author("Kevin ");
+ /// ```no_run
+ /// # use clap::{App, Arg};
+ /// # let app = App::new("myprog")
+ /// .author("Kevin ")
+ /// # .get_matches();
/// ```
pub fn author(&mut self, a: &'static str) -> &mut App {
self.author = Some(a);
@@ -103,8 +110,11 @@ impl App {
///
/// Example:
///
- /// ```rust.example
- /// .about("Does really amazing things to great people");
+ /// ```no_run
+ /// # use clap::{App, Arg};
+ /// # let app = App::new("myprog")
+ /// .about("Does really amazing things to great people")
+ /// # .get_matches();
/// ```
pub fn about(&mut self, a: &'static str) -> &mut App {
self.about = Some(a);
@@ -115,8 +125,11 @@ impl App {
///
/// Example:
///
- /// ```rust.example
- /// .version("v0.1.24");
+ /// ```no_run
+ /// # use clap::{App, Arg};
+ /// # let app = App::new("myprog")
+ /// .version("v0.1.24")
+ /// # .get_matches();
/// ```
pub fn version(&mut self, v: &'static str)-> &mut App {
self.version = Some(v);
@@ -127,10 +140,14 @@ impl App {
///
/// Example:
///
- /// ```rust.example
+ /// ```no_run
+ /// # use clap::{App, Arg};
+ /// # let app = App::new("myprog")
/// .arg(Arg::new("config")
- /// // Additional argument configuration goes here...
- /// );
+ /// .short("c")
+ /// // Additional argument configuration goes here...
+ /// )
+ /// # .get_matches();
/// ```
pub fn arg(&mut self, a: &Arg) -> &mut App {
if self.arg_list.contains(a.name) {
@@ -228,9 +245,12 @@ impl App {
///
/// Example:
///
- /// ```rust.example
+ /// ```no_run
+ /// # use clap::{App, Arg};
+ /// # let app = App::new("myprog")
/// .args( vec![Arg::new("config").short("c"),
- /// Arg::new("debug").short("d")]);
+ /// Arg::new("debug").short("d")])
+ /// # .get_matches();
/// ```
pub fn args(&mut self, args: Vec<&Arg>) -> &mut App {
for arg in args.iter() {
diff --git a/src/arg.rs b/src/arg.rs
index 2e9cbfeb..97d7bcb8 100644
--- a/src/arg.rs
+++ b/src/arg.rs
@@ -8,7 +8,8 @@
///
/// Example:
///
-/// ```rust.example
+/// ```no_run
+/// # use clap::{App, Arg};
/// # let matches = App::new("myprog")
/// # .arg(
/// Arg::new("conifg")
@@ -62,10 +63,12 @@ impl Arg {
///
/// Example:
///
- /// ```rust.example
+ /// ```no_run
+ /// # use clap::{App, Arg};
/// # let matches = App::new("myprog")
/// # .arg(
/// Arg::new("conifg")
+ /// # .short("c")
/// # ).get_matches();
pub fn new(n: &'static str) -> Arg {
Arg {
@@ -94,7 +97,8 @@ impl Arg {
/// mistakenly sets the short to `-o` or the like.
/// Example:
///
- /// ```rust.example
+ /// ```no_run
+ /// # use clap::{App, Arg};
/// # let matches = App::new("myprog")
/// # .arg(
/// # Arg::new("conifg")
@@ -118,7 +122,8 @@ impl Arg {
///
/// Example:
///
- /// ```rust.example
+ /// ```no_run
+ /// # use clap::{App, Arg};
/// # let matches = App::new("myprog")
/// # .arg(
/// # Arg::new("conifg")
@@ -134,7 +139,8 @@ impl Arg {
///
/// Example:
///
- /// ```rust.example
+ /// ```no_run
+ /// # use clap::{App, Arg};
/// # let matches = App::new("myprog")
/// # .arg(
/// # Arg::new("conifg")
@@ -156,7 +162,8 @@ impl Arg {
///
/// Example:
///
- /// ```rust.example
+ /// ```no_run
+ /// # use clap::{App, Arg};
/// # let matches = App::new("myprog")
/// # .arg(
/// # Arg::new("conifg")
@@ -176,7 +183,8 @@ impl Arg {
///
/// Example:
///
- /// ```rust.example
+ /// ```no_run
+ /// # use clap::{App, Arg};
/// # let myprog = App::new("myprog").arg(Arg::new("conifg")
/// .mutually_excludes("debug")
/// # ).get_matches();
@@ -198,7 +206,8 @@ impl Arg {
///
/// Example:
///
- /// ```rust.example
+ /// ```no_run
+ /// # use clap::{App, Arg};
/// # let myprog = App::new("myprog").arg(Arg::new("conifg")
/// .mutually_excludes_all(
/// vec!["debug", "input"])
@@ -221,7 +230,8 @@ impl Arg {
///
/// Example:
///
- /// ```rust.example
+ /// ```no_run
+ /// # use clap::{App, Arg};
/// # let myprog = App::new("myprog").arg(Arg::new("conifg")
/// .requires("debug")
/// # ).get_matches();
@@ -242,7 +252,8 @@ impl Arg {
///
/// Example:
///
- /// ```rust.example
+ /// ```no_run
+ /// # use clap::{App, Arg};
/// # let myprog = App::new("myprog").arg(Arg::new("conifg")
/// .requires_all(
/// vec!["debug", "input"])
@@ -265,7 +276,8 @@ impl Arg {
///
/// Example:
///
- /// ```rust.example
+ /// ```no_run
+ /// # use clap::{App, Arg};
/// # let matches = App::new("myprog")
/// # .arg(
/// # Arg::new("conifg")
@@ -286,7 +298,8 @@ impl Arg {
///
/// Example:
///
- /// ```rust.example
+ /// ```no_run
+ /// # use clap::{App, Arg};
/// # let matches = App::new("myprog")
/// # .arg(
/// # Arg::new("conifg")
@@ -309,7 +322,8 @@ impl Arg {
///
/// Example:
///
- /// ```rust.example
+ /// ```no_run
+ /// # use clap::{App, Arg};
/// # let matches = App::new("myprog")
/// # .arg(
/// # Arg::new("debug")
diff --git a/src/argmatches.rs b/src/argmatches.rs
index 87b9be5b..7232f6ca 100644
--- a/src/argmatches.rs
+++ b/src/argmatches.rs
@@ -11,7 +11,8 @@ use args::{ FlagArg, OptArg, PosArg };
/// Fields of `ArgMatches` aren't designed to be used directly, only
/// the methods in order to query information.
///
-/// ```rust.example
+/// ```no_run
+/// # use clap::{App, Arg};
/// let matches = App::new("MyApp")
/// // adding of arguments and configuration goes here...
/// # .arg(Arg::new("config")
@@ -20,7 +21,7 @@ use args::{ FlagArg, OptArg, PosArg };
/// # .takes_value(true))
/// # .arg(Arg::new("debug")
/// # .short("d")
-/// # .multiple(true)
+/// # .multiple(true))
/// .get_matches();
/// // if you had an argument named "output" that takes a value
/// if let Some(o) = matches.value_of("output") {
@@ -63,7 +64,8 @@ impl ArgMatches {
///
/// Example:
///
- /// ```rust.example
+ /// ```no_run
+ /// # use clap::{App, Arg};
/// let matches = App::new("myprog").get_matches();
/// ```
pub fn new(app: &App) -> ArgMatches {
@@ -86,7 +88,9 @@ impl ArgMatches {
///
/// Example:
///
- /// ```rust.example
+ /// ```no_run
+ /// # use clap::{App, Arg};
+ /// # let matches = App::new("myapp").arg(Arg::new("output").takes_value(true)).get_matches();
/// if let Some(o) = matches.value_of("output") {
/// println!("Value for output: {}", o);
/// }
@@ -111,7 +115,9 @@ impl ArgMatches {
///
/// Example:
///
- /// ```rust.example
+ /// ```no_run
+ /// # use clap::{App, Arg};
+ /// # let matches = App::new("myapp").arg(Arg::new("output").takes_value(true)).get_matches();
/// if matches.is_present("output") {
/// println!("The output argument was used!");
/// }
@@ -134,7 +140,9 @@ impl ArgMatches {
///
/// Example:
///
- /// ```rust.example
+ /// ```no_run
+ /// # use clap::{App, Arg};
+ /// # let matches = App::new("myapp").arg(Arg::new("output").takes_value(true)).get_matches();
/// if matches.occurrences_of("debug") > 1 {
/// println!("Debug mode is REALLY on");
/// } else {
diff --git a/src/lib.rs b/src/lib.rs
index c6091ad9..2a67c69f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,6 +1,6 @@
#![crate_type= "lib"]
-#![feature(collections, core, libc, env)]
+#![feature(collections, core, libc)]
//! A simply library for parsing command line arguments when writing
//! command line and console applications.
@@ -16,8 +16,7 @@
//!
//! Example:
//!
-//! ```rust.example
-//! extern crate clap;
+//! ```no_run
//! use clap::{Arg, App};
//!
//! // ...