Simple and minimal command line argument parser for Rust.
```rust extern crate surd;
fn main() { // Create a new surd app. let mut app = surd::Surd::new("test", "a test app", "aiocat", "1.0.0"); app.addflag("t", "a test flag", Vec::new()); app.sethandler(run_main);
// Create a sub-command for main app.
let mut test_command = surd::SubCommand::new("test", "a test command");
test_command.add_usage("test test");
test_command.add_flag("at", "another test flag", vec!["atest".to_string()]);
test_command.add_alias("t".to_string());
test_command.set_handler(run_test);
app.add_command(test_command);
// Handle the command.
app.start();
}
fn runmain(foundflags: &Vec
for i in found_flags.iter() {
println!("{} - {}", i.description, i.value);
}
}
fn runtest(foundflags: &Vec
for i in found_flags.iter() {
println!("{} - {}", i.description, i.value);
}
} ```
If you found a bug or an error, please create a new issue at gitlab repository.
If you want to contribute this project:
This project is distributed under MIT license.
Under development.