You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bubbyroosh 2294f477b5 AAAA 2 months ago
src AAAA 2 months ago
.gitignore Add Rust stuff 8 months ago
Cargo.toml AAAA 2 months ago
LICENSE relicense lol gpl cringe 4 months ago
README.md separate argument name from argument long name 3 months ago

README.md

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"]