Added case to not crash when checking a list that is too short

This commit is contained in:
Maddox Werts 2025-03-21 10:18:20 -04:00
parent 894ef92ac3
commit 432cd5f695

View file

@ -29,6 +29,16 @@ impl Arguments {
continue;
}
// Is there something else after this?
if i + 1 > args.len() {
result.push(Argument {
key: args[i].clone(),
val: String::new(),
});
continue;
}
// Figuring out what kind of variable it is
if args[i + 1].starts_with("--") {
result.push(Argument {