argster

Crates.ioargster
lib.rsargster
version0.1.1
sourcesrc
created_at2023-12-02 07:08:12.806147
updated_at2023-12-02 07:55:51.526424
descriptionA simple parser for command line arguments
homepage
repositoryhttps://github.com/LaSpruca/argster
max_upload_size
id1055967
size14,658
Connor Hare (LaSpruca)

documentation

README

Argster

A simple command line parser


Argster example

Example

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();
}

Command syntax

    -<c>
    -<c><value>
    -<c> <value>
    --<name>
    --<name> <value>
Commit count: 10

cargo fmt