Crates.io | argster-macros |
lib.rs | argster-macros |
version | 0.1.1 |
source | src |
created_at | 2023-12-02 07:07:55.281561 |
updated_at | 2023-12-02 07:55:35.167821 |
description | A simple parser for command line arguments |
homepage | |
repository | https://github.com/LaSpruca/argster |
max_upload_size | |
id | 1055966 |
size | 14,280 |
A simple command line parser
use argster::command;
struct App;
#[command]
impl App {
/// A hello command
/// # Args
/// input The name to greet
/// --number -n The number of times to greet them
fn hello(input: String, times: Option<u32>) {
for _ in 0..times.unwrap_or(1) {
println!("Hello {input}");
}
}
}
fn main() {
App::main();
}
-<c>
-<c><value>
-<c> <value>
--<name>
--<name> <value>