16 releases

0.2.6 Aug 29, 2022
0.2.5 Aug 13, 2021
0.2.0 May 24, 2021
0.1.9 May 24, 2021
0.1.5 Feb 25, 2021

#7 in #copyright

Download history 7/week @ 2024-07-13 26/week @ 2024-09-21 6/week @ 2024-09-28

98 downloads per month
Used in 3 crates (2 directly)

ISC license

13KB
274 lines

Example:

let mut args = ArgParser::new("rargsxd_example");
args.info("A test example for rargsxd")
    .author("BubbyRoosh")
    .version("0.1.0")
    .copyright("Copyright (C) 2021 BubbyRoosh")
    // All instances of {name} are replaced with the name of the program.
    .usage("{name} [arguments] [other ...]")
    .args(vec!(
    	Arg::bool("test", false)
    	    .short('t')
    	    .help("Test boolean argument"),
    	Arg::str("long", "")
    	    .long("long-argument")
    	    .help("Long argument test"),
    )).parse();

println!("{}", args.get_bool("test"));
println!("{}", args.get_str("long"));
println!("{:?}", args.extra);

Assuming the args passed are: -t --long-argument word another word

It would output:

word
true
["another", "word"]

No runtime deps