General template for building command line interface (CLI) using (and written in) Rust
Cargo.toml
```toml ...
[dependencies] medusa = "0.1.0" ... ```
rust
...
use medusa::{CommandLine, HandlerVariant};
...
```rust ... fn hello() { println!("Hello, world!"); }
fn echo(payload: String) { println!("payload : {}", payload); } ... ```
```rust ... use std::collections::HashMap;
let mut handlers: HashMap
```rust ... use std::env;
let mut command: CommandLine = CommandLine::new(); command.set_handler(handlers); command.run(env::args()); ... ```
bash
cargo run -- --hello
cargo run -- --echo something
bash
cargo build