generated from OBJNULL/Dockerized-Rust
Added case to not crash when checking a list that is too short
This commit is contained in:
parent
894ef92ac3
commit
432cd5f695
1 changed files with 10 additions and 0 deletions
|
@ -29,6 +29,16 @@ impl Arguments {
|
||||||
continue;
|
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
|
// Figuring out what kind of variable it is
|
||||||
if args[i + 1].starts_with("--") {
|
if args[i + 1].starts_with("--") {
|
||||||
result.push(Argument {
|
result.push(Argument {
|
||||||
|
|
Loading…
Reference in a new issue