Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Latest commit

 

History

History
25 lines (21 loc) · 360 Bytes

README.md

File metadata and controls

25 lines (21 loc) · 360 Bytes

🗃 arguments-parser

How to use

use std::env;
use args::Args;

fn main() {
    // i# - type i32
    // s* - type &str
    // b  - type bool
    let arg = Args::new("i#,s*,b", env::args());

    if arg.get_i32("i") == 1 {
        ...
    }
    if arg.get_str("s") == "..." {
        ...
    }
    if arg.get_bool("b") {
        ...
    }
}