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
18
use cliargs::Cmd;

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

        let args = cmd.args();
        let arg1 = args[0];
        println!("command args (within the scope = {arg1:?}");

        arg1
    }

    let arg1 = returns_one_of_cmd_args();
    println!("command args (out of the scope) = {arg1:?}");
}