From 9fa2be824f36bc00870b5ba80fedb2e76671c1c3 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 19 Aug 2017 16:27:28 +0100 Subject: [PATCH] Remove safety check, error handling has that case already --- bin/src/main.rs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/bin/src/main.rs b/bin/src/main.rs index 4d258e19..b895ab4b 100644 --- a/bin/src/main.rs +++ b/bin/src/main.rs @@ -204,13 +204,6 @@ fn main() { None => Vec::new() }; - // Typos happen, so check if the given subcommand is one found in $PATH - if !commands.contains(&String::from(subcommand)) { - println!("No such command: 'imag-{}'", subcommand); - println!("See 'imag --help' for available subcommands"); - exit(2); - } - debug!("Calling 'imag-{}' with args: {:?}", subcommand, subcommand_args); // Create a Command, and pass it the gathered arguments @@ -235,8 +228,6 @@ fn main() { debug!("Error calling the subcommand"); match e.kind() { ErrorKind::NotFound => { - // With the check above, this absolutely should not happen. - // Keeping it to be safe println!("No such command: 'imag-{}'", subcommand); println!("See 'imag --help' for available subcommands"); exit(2);