use rargsxd::*;
let args = vec!("testword".to_string(), "--testflag".to_string(), "-o".to_string(), "monke".to_string());
let mut parser = ArgParser::new("program_lol");
parser.author("BubbyRoosh")
.version("0.1.0")
.copyright("Copyright (C) 2021 BubbyRoosh")
.info("Example for simple arg parsing crate OwO")
.require_args(true)
.args(
vec!(
Arg::new("testflag")
.short('t')
.help("This is a test flag.")
.flag(false),
Arg::new("testoption")
.short('o')
.help("This is a test option.")
.option("option"),
Arg::new("testword")
.help("This is a test option.")
.word(WordType::Boolean(false)),
)
).parse_vec(args);
assert!(parser.get_flag("testflag").unwrap());
assert!(parser.get_word("testword").unwrap().as_bool().unwrap());
assert_eq!(parser.get_option("testoption").unwrap(), "monke");