3 releases
Uses new Rust 2024
new 0.1.2 | Apr 15, 2025 |
---|---|
0.1.1 | Apr 15, 2025 |
0.1.0 | Mar 20, 2025 |
#4 in #args
118 downloads per month
6KB
72 lines
A simple command-line argument helper for parsing positional arguments and options.
Example:
use valargs::Args;
fn main() {
let args = Args::parse();
if let Some(cat_name) = args.nth(1) {
println!("the cat's name is {}", cat_name);
}
if args.has_option("orange") {
println!("the cat is an orange cat")
}
if let Some(favorite_food) = args.option_value("favorite-food") {
println!("the cat likes {} a lot", favorite_food)
} else {
println!("no information about the cat's favorite food...")
}
}