Popularity
0.3
Declining
Activity
0.0
Stable
3
1
0
Programming language: Rust
License: GNU General Public License v3.0 or later
easy_flag alternatives and similar packages
Based on the "Command-line argument parsing" category.
Alternatively, view easy_flag alternatives based on common mentions on social networks and blogs.
Less time debugging, more time building
Scout APM allows you to find and fix performance issues with no hassle. Now with error monitoring and external services monitoring, Scout is a developer's best friend when it comes to application development.
Promo
scoutapm.com
Do you think we are missing an alternative of easy_flag or a related project?
README
easy_flag
Simple command line flag parser for rust.
use easy_flag::FlagSet;
fn main() -> Result<(), String>{
let mut help = false;
let mut my_flag = String::from("default value");
let args: Vec<String> = std::env::args().collect();
let mut my_set = FlagSet::new(&args[0])
.add("-h, --help", &mut help, "Prints help message.")
.add("-m, --my-flag", &mut my_flag, "Help message for my_flag with string `value`");
if let Err(err) = my_set.parse(&args[1..]) {
println!("{}", my_set.defaults());
return Err(err);
}
let usage = my_set.usage();
if help {
println!("{}", usage);
return Ok(());
}
println!("my_flag flag value: {}", my_flag);
Ok(())
}
License
Licensed under either of Apache License, Version2.0 or MIT license at your option.
*Note that all licence references and agreements mentioned in the easy_flag README section above
are relevant to that project's source code only.