diff --git a/src/main.rs b/src/main.rs index 79736a8..c7e3cb1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -86,7 +86,10 @@ async fn main() -> std::io::Result<()> { std::process::exit(-2); } - let args = &args[3..]; + let args = match args.len() { + 0 | 1 | 2 => vec![], + _ => (&args[3..]).to_vec() + }; let res = (selected_action.function)(args.to_vec()); res.expect("Failed to execute action!");