14 releases (7 breaking)

0.7.2 Jun 28, 2023
0.7.1 Nov 16, 2022
0.6.3 Nov 5, 2022
0.6.2 Oct 23, 2016
0.5.1 Jul 9, 2015

#145 in Command-line interface

Download history 323/week @ 2024-01-02 429/week @ 2024-01-09 405/week @ 2024-01-16 155/week @ 2024-01-23 199/week @ 2024-01-30 104/week @ 2024-02-06 137/week @ 2024-02-13 330/week @ 2024-02-20 388/week @ 2024-02-27 178/week @ 2024-03-05 374/week @ 2024-03-12 194/week @ 2024-03-19 273/week @ 2024-03-26 213/week @ 2024-04-02 334/week @ 2024-04-09 188/week @ 2024-04-16

1,054 downloads per month
Used in 6 crates

Apache-2.0/MIT

10KB
162 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