cliargs 0.6.0

Parses command line arguments and prints the help.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use cliargs::Cmd;

fn main() {
    fn returns_opt_arg() -> &'static str {
        let mut cmd =
            cliargs::Cmd::with_strings(["/path/to/app".to_string(), "--foo=bar".to_string()]);
        cmd.parse().unwrap();

        let opt_arg = cmd.opt_arg("foo").unwrap();
        println!("option arg (within the scope = {opt_arg:?}");

        opt_arg
    }

    let opt_arg = returns_opt_arg();
    println!("option arg (out of the scope) = {opt_arg:?}");
}