climake-1.0.2 has been yanked.
climake
The simple, dependency-less cli framework ✨
Example 📚
use climake::*;
fn qwerty_run_me(args: Vec<String>) {
println!(
"The -q (or --qwerty) argument was ran! Here are the arguments passed: {:?}.",
args
);
}
fn other_arg_main(_args: Vec<String>) {
println!("The normal --other or -o or -t argument.");
}
fn main() {
let qwerty_arg = CliArgument::new(
vec!['q'],
vec!["qwerty"],
Some("Some useful help info."),
Box::new(&qwerty_run_me), );
let other_arg = CliArgument::new(
vec!['o', 't'],
vec!["other"],
None, Box::new(&other_arg_main),
);
let mut cli = CliMake::new(
vec![qwerty_arg, other_arg],
Some("This is some help info for this example CLI."),
)
.unwrap();
cli.parse() }
Installation 🚀
Simply add the following to your Cargo.toml file:
[dependancies]
climake = "1.0"