bene

Crates.iobene
lib.rsbene
version0.1.1
sourcesrc
created_at2023-05-22 04:18:05.567777
updated_at2023-05-22 21:56:11.023196
descriptionA command line argument parser/reader
homepage
repositoryhttps://github.com/sagansfault/bene
max_upload_size
id870353
size4,891
sagan (sagansfault)

documentation

README

bene

Bene is a library for parsing command line arguments efficiently and elegantly.

Example:
The command line arguments:

-f 20 --length 5 --lib

Would be parsed as:

let mut frames: usize = 30; // default values
let mut length = 3; // inferred i32
let mut lib = false; // non valued flags are treated as booleans

// let input = "-f 20 --length 5 --lib"
bene::Intake::new()
    .arg('f', "frames", &mut frames)
    .arg('l', "length", &mut length)
    .arg('L', "lib", &mut lib) // case sensitive!
    .process(input);

assert_eq!(frames, 20);
assert_eq!(length, 5);
assert_eq!(lib, true);
Commit count: 5

cargo fmt