Crates.io | collect_args |
lib.rs | collect_args |
version | 0.0.2 |
source | src |
created_at | 2024-07-14 16:35:43.336743 |
updated_at | 2024-07-14 16:55:55.948194 |
description | Parses env args |
homepage | https://github.com/seacrst/collect_args |
repository | |
max_upload_size | |
id | 1303119 |
size | 7,106 |
let args = Args::collect();
let bar = args.input("foo").1.expect("Following value is required");
let (kek, is_kek) = args.flag("kek");
let opts = args.options(&["bar", "baz"]);
match opts.unwrap_or(String::from("nothing")) {
String::from("bar") => todo!()
String::from("baz") => todo!()
_ => todo!()
}
let (sel_key, opt) = args.select("sel_key", &["opt1", "opt2", "opt3"]);
let opt_value = opr.expect("Please enter {sel_key} option");