| Crates.io | xtask-cmdwrap-macro |
| lib.rs | xtask-cmdwrap-macro |
| version | 0.1.0 |
| created_at | 2025-04-25 06:32:01.416997+00 |
| updated_at | 2025-04-25 06:32:01.416997+00 |
| description | Procedural macros for xtask-cmdwrap |
| homepage | |
| repository | https://github.com/defermelowie/xtask-cmdwrap |
| max_upload_size | |
| id | 1648551 |
| size | 11,615 |
[!IMPORTANT] This is a work in progress, nothing is guaranteed (yet)
The main idea is to define commands one of the following ways:
use std::ffi::OsStr;
#[command]
struct Echo {
/// Do not output the trailing newline
#[arg(single)]
n: bool,
/// Enable interpretation fo backslash escapes
#[arg(single)]
e: bool,
/// Display help and exit
#[arg(double)]
help: bool,
/// Display version info and exit
#[arg(double)]
version:bool,
/// The string to echo
string: OsStr,
}
prefix="--"postfix=" "name=IDENTflag is absentuse std::ffi::OsStr;
#[cmd(name="/bin/echo")]
struct Echo {
/// Do not output the trailing newline
#[cmd::opt(flag, prefix="-", name="n")]
no_newline: bool,
/// Enable interpretation fo backslash escapes
#[cmd::opt(flag, prefix="-", name="e")]
escape: bool,
/// Display help and exit
#[cmd::opt(flag, prefix="--")]
help: bool,
/// Display version info and exit
#[cmd::opt(flag, prefix="--")]
version: bool,
/// The string to echo
string: OsStr,
}
/bin/echo [-n] [-e] [--help] [--version] STRING