seahorse

crates.io

A minimal CLI framework written in Rust

Using

toml [dependencies] seahorse = "0.2.1"

Example

```rust use std::env; use seahorse::{App, Command, color};

fn main() { let args: Vec = env::args().collect(); let displayname = color::magenta(" ██████╗██╗ ██╗ ██╔════╝██║ ██║ ██║ ██║ ██║ ██║ ██║ ██║ ╚██████╗███████╗██║ ╚═════╝╚══════╝╚═╝"); let command = Command { name: "hello", usage: "clitool hello user", action: |v: Vec| println!("Hello, {:?}", v) };

let mut app = App::new()
    .name("cli_tool")
    .display_name(display_name)
    .usage("cli_tool [command] [arg]")
    .version(env!("CARGO_PKG_VERSION"))
    .commands(vec![command]);

app.run(args);

} ```