]>
git.proxmox.com Git - rustc.git/blob - src/vendor/docopt/examples/verbose_multiple.rs
1 extern crate rustc_serialize
;
6 // This shows how to implement multiple levels of verbosity.
8 // When you have multiple patterns, I think the only way to carry the
9 // repeated flag through all of them is to specify it for each pattern
12 // This is unfortunate.
13 const USAGE
: &'
static str = "
14 Usage: cp [options] [-v | -vv | -vvv] <source> <dest>
15 cp [options] [-v | -vv | -vvv] <source>... <dir>
18 -a, --archive Copy everything.
19 -v, --verbose Show extra log output.
22 #[derive(Debug, RustcDecodable)]
24 arg_source
: Vec
<String
>,
32 let args
: Args
= Docopt
::new(USAGE
)
33 .and_then(|d
| d
.decode())
34 .unwrap_or_else(|e
| e
.exit());
35 println
!("{:?}", args
);