Crates.io | cmdstruct |
lib.rs | cmdstruct |
version | 2.0.1 |
source | src |
created_at | 2024-03-25 10:32:56.378439 |
updated_at | 2024-05-08 09:20:16.639205 |
description | A lightweight macro for implementing commands with a struct |
homepage | |
repository | https://github.com/ReverentEngineer/cmdstruct |
max_upload_size | |
id | 1185146 |
size | 19,369 |
A lightweight macro for implementing commands with a struct
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();
}