1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! Parser for command-line arguments.
//!
//! ## Example
//!
//! ```
//! // foo --no-bar --baz 42 --baz 69 --qux "Hello, world!"
//! let arguments = std::env::args();
//! # let arguments = vec![
//! # "foo",
//! # "--no-bar",
//! # "--baz", "42",
//! # "--baz", "69",
//! # "--qux", "Hello, world!",
//! # ];
//! # let arguments = arguments.iter().map(|argument| argument.to_string());
//! let arguments = arguments::parse(arguments).unwrap();
//!
//! assert_eq!(arguments.program, "foo");
//! assert_eq!(arguments.get::<bool>("bar").unwrap(), false);
//! assert_eq!(arguments.get::<usize>("baz").unwrap(), 69);
//! assert_eq!(arguments.get_all::<usize>("baz").unwrap(), &[42, 69]);
//! assert_eq!(arguments.get::<String>("qux").unwrap(), "Hello, world!");
//! ```
;
pub use Options;
pub use crateArguments;
/// Parse command-line arguments.