diff --git a/bootpkg/src/args.rs b/bootpkg/src/args.rs index 0df76c9..373830b 100644 --- a/bootpkg/src/args.rs +++ b/bootpkg/src/args.rs @@ -18,9 +18,20 @@ pub struct Args { impl From> for Args { fn from(value: Vec) -> Self { + if value.len() == 0 { + return Args { + command: Command::from(String::default()), + args: vec![], + } + } + Args { command: Command::from(value[0].to_owned()), - args: value[1..].to_owned(), + args: if value.len() > 1 { + value[1..].to_owned() + } else { + vec![] + }, } } }