Exit when unknown argument is passed

This commit is contained in:
Sayantan Santra 2022-12-09 14:13:35 -06:00
parent d2c6670901
commit 0b64b0eae6
2 changed files with 2 additions and 1 deletions

View file

@ -165,6 +165,7 @@ pub fn process_args(mut args: Vec<String>) -> (Vec<String>, HashMap<&'static str
other => {
if other.starts_with("-") {
eprintln!("Unknown argument passed: {}", other);
exit(1);
} else {
entries.push(arg);
}

View file

@ -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