yomi

Crates.ioyomi
lib.rsyomi
version0.1.2
sourcesrc
created_at2024-09-30 21:14:37.166521
updated_at2024-10-09 14:27:13.39246
descriptionSimple styled CLI builder and terminal command executor.
homepage
repositoryhttps://github.com/dehwyy/yomi
max_upload_size
id1392216
size23,601
dehwyy (dehwyy)

documentation

README

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.

Commit count: 10

cargo fmt