arguments

Crates.ioarguments
lib.rsarguments
version0.7.2
sourcesrc
created_at2015-06-14 23:36:25.091066
updated_at2023-06-28 08:35:00.28426
descriptionThe package provides a parser for command-line arguments.
homepagehttps://github.com/stainless-steel/arguments
repositoryhttps://github.com/stainless-steel/arguments
max_upload_size
id2381
size12,070
Owners (github:buoyantio:owners)

documentation

https://docs.rs/arguments

README

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.

Commit count: 44

cargo fmt