15 releases (8 breaking)

0.8.0 Nov 12, 2024
0.7.2 Jun 28, 2023
0.7.1 Nov 16, 2022
0.6.2 Oct 23, 2016
0.5.1 Jul 9, 2015

#163 in Command-line interface

Download history 288/week @ 2024-08-17 207/week @ 2024-08-24 259/week @ 2024-08-31 98/week @ 2024-09-07 124/week @ 2024-09-14 154/week @ 2024-09-21 105/week @ 2024-09-28 226/week @ 2024-10-05 411/week @ 2024-10-12 265/week @ 2024-10-19 242/week @ 2024-10-26 208/week @ 2024-11-02 281/week @ 2024-11-09 257/week @ 2024-11-16 255/week @ 2024-11-23 231/week @ 2024-11-30

1,047 downloads per month
Used in 7 crates

Apache-2.0/MIT

9KB
132 lines

Arguments Package Documentation Build

The package provides a parser for command-line arguments.

Example

// foo --no-bar --baz 42 --baz 69 --qux "Hello, world!"
let arguments = std::env::args();
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!");

Contribution

Your contribution is highly appreciated. Do not hesitate to open an issue or a pull request. Note that any contribution submitted for inclusion in the project will be licensed according to the terms given in LICENSE.md.

Dependencies

~10KB