| Crates.io | valargs |
| lib.rs | valargs |
| version | 0.1.7 |
| created_at | 2025-03-20 19:53:27.623336+00 |
| updated_at | 2025-07-26 12:56:15.060358+00 |
| description | A simple cli argument parser. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1599705 |
| size | 6,341 |
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("favorite-food") {
println!("the cat likes {} a lot", favorite_food)
} else {
println!("no information about the cat's favorite food...")
}
}