minargs 0.1.0

🚀 Ultra-lightweight, blazing-fast, zero-dependency CLI parser — inspired by Clap.
Documentation
  • Coverage
  • 0%
    0 out of 2 items documented0 out of 0 items with examples
  • Size
  • Source code size: 10.73 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 201.85 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • nehu3n/minargs
    11 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • nehu3n

minargs

🚀 Minargs is a blazing-fast, ultra-lightweight argument parser for Rust — zero dependencies, zero bloat.


✨ Features

  • ✅ Simple, expressive and functional API
  • 🧠 Zero dependencies
  • ⚡️ Extremely fast parsing logic
  • 📦 Tiny binary size

📚️ Example

use minargs::App;

fn main() {
    let matches = App::new("mytool")
        .version("0.1.0")
        .about("Ultra-light CLI parser demo")
        .arg("input", |a| a.required(true).help("Path to input file"))
        .arg("verbose", |a| a.short('v').long("verbose").takes_value(false))
        .subcommand("init", |cmd| {
            cmd.about("Initialize a project").arg("path", |a| a.help("Optional path"))
        })
        .parse();

    match matches.subcommand() {
        Some("init") => {
            let sub = matches.sub_matches().unwrap();
            println!("Init path: {:?}", sub.get("path"));
        }
        _ => {
            println!("Input: {}", matches.get("input").unwrap());
            if matches.has("verbose") {
                println!("Verbose mode enabled.");
            }
        }
    }
}

📦 Installation

Add it to your Cargo.toml:

[dependencies]

minargs = "0.1.0"

Or install via Cargo:

cargo add minargs


📄 License

Licensed under the MIT License.