3 releases
0.1.2 | Oct 9, 2024 |
---|---|
0.1.1 | Sep 30, 2024 |
0.1.0 | Sep 30, 2024 |
#297 in Cargo plugins
137 downloads per month
9KB
180 lines
Yomi
Simple styled CLI builder + terminal command executor.
Usage Example
use yomi::prelude::{Parser, Subcommand};
use yomi::{Cli, CommandExecutor};
#[derive(Subcommand)]
enum InputCommand {
/// cargo {crate_name} mk.
#[command(name = "mk")]
MakeDirectory,
/// cargo {crate_name} rm.
#[command(name = "rm")]
RemoveDirectory,
}
#[tokio::main]
async fn main() {
let cli = Cli::<InputCommand>::parse();
let r = match cli.get() {
InputCommand::MakeDirectory => CommandExecutor::execute("mkdir random_directory"),
InputCommand::RemoveDirectory => CommandExecutor::execute("rm -rf random_directory"),
};
r.await.unwrap();
}
More examples.
Dependencies
~6–15MB
~177K SLoC