cmdstruct

Crates.iocmdstruct
lib.rscmdstruct
version2.0.1
sourcesrc
created_at2024-03-25 10:32:56.378439
updated_at2024-05-08 09:20:16.639205
descriptionA lightweight macro for implementing commands with a struct
homepage
repositoryhttps://github.com/ReverentEngineer/cmdstruct
max_upload_size
id1185146
size19,369
Jeff Caffrey-Hill (ReverentEngineer)

documentation

https://docs.rs/cmdstruct

README

cmdstruct

A lightweight macro for implementing commands with a struct

Documentation

Usage

use cmdstruct::Command;

#[derive(Command)]
#[command(executable = "echo")]
struct Echo {

    /// Flag to provide
    #[arg(flag = "-n")]
    no_new_line: bool,

    /// String to echo
    #[arg]
    s: String

}

fn main() {
    let echo = Echo {
        no_new_line: true,
        s: "hello world".to_string()
    };

    echo.command().spawn();
}

Commit count: 14

cargo fmt