summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2017-08-25 17:36:22 +0200
committerGitHub <noreply@github.com>2017-08-25 17:36:22 +0200
commitec1c1e8e3d40ec8c95947bdf66c448fbad5e6a40 (patch)
treedaf80fa6a9a108759d477b147bb654f1d50afd5f
parentfc5bbc3b9df91f4dd93bfa11ec0b71dddd593d2d (diff)
parent9fa2be824f36bc00870b5ba80fedb2e76671c1c3 (diff)
downloadimag-ec1c1e8e3d40ec8c95947bdf66c448fbad5e6a40.zip
imag-ec1c1e8e3d40ec8c95947bdf66c448fbad5e6a40.tar.gz
Merge pull request #1007 from matthiasbeyer/bin-refactor
Remove safety check, error handling has that case already
-rw-r--r--bin/src/main.rs9
1 files changed, 0 insertions, 9 deletions
diff --git a/bin/src/main.rs b/bin/src/main.rs
index 4d258e1..b895ab4 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);