From 0b64b0eae6047588b99c4056d816e70ff760cc6c Mon Sep 17 00:00:00 2001 From: SinTan1729 Date: Fri, 9 Dec 2022 14:13:35 -0600 Subject: [PATCH] Exit when unknown argument is passed --- src/functions.rs | 1 + src/main.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/functions.rs b/src/functions.rs index ded1883..a2f4dfb 100644 --- a/src/functions.rs +++ b/src/functions.rs @@ -165,6 +165,7 @@ pub fn process_args(mut args: Vec) -> (Vec, HashMap<&'static str other => { if other.starts_with("-") { eprintln!("Unknown argument passed: {}", other); + exit(1); } else { entries.push(arg); } diff --git a/src/main.rs b/src/main.rs index 9b7bb37..7ac648c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -27,7 +27,7 @@ fn main() { if api_key == "" { eprintln!("Error reading the config file. Pass --help to see help."); - exit(1); + exit(2); } // Create TMDb object for API calls