Skip to content

nehu3n/minargs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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.


About

πŸš€ Ultra-lightweight, blazing-fast, zero-dependency CLI parser β€” inspired by Clap.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages