summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2018-04-08 20:38:46 +0200
committerMatthias Beyer <mail@beyermatthias.de>2018-04-08 20:38:46 +0200
commit16a76f6213f938eede88efd6e8ea1c9f944dfc59 (patch)
treefe061826916834e91b25bf716f91f3a290df7c92 /lib
parent8b29e9d7480cd83b51aa1f8199ffd1bb6d6172c6 (diff)
Exit if handler does not find subcommand
Diffstat (limited to 'lib')
-rw-r--r--lib/core/libimagrt/src/runtime.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/core/libimagrt/src/runtime.rs b/lib/core/libimagrt/src/runtime.rs
index 07b24bd4..286b6320 100644
--- a/lib/core/libimagrt/src/runtime.rs
+++ b/lib/core/libimagrt/src/runtime.rs
@@ -520,10 +520,16 @@ impl<'a> Runtime<'a> {
/// 3. The `ArgMatches` object from the call, so that this routine can forward all flags passed
/// to the `bar` subcommand.
///
+ /// # Warning
+ ///
+ /// If, and only if, the subcommand does not exist (as in `::std::io::ErrorKind::NotFound`),
+ /// this function exits with 1 as exit status.
+ ///
/// # Return value
///
/// On success, the exit status object of the `Command` invocation is returned.
- /// On Error, a RuntimeError object is returned.
+ /// On Error, a RuntimeError object is returned. This is also the case if writing the error
+ /// message does not work.
///
/// # Details
///
@@ -573,7 +579,7 @@ impl<'a> Runtime<'a> {
return e;
}
- e
+ ::std::process::exit(1)
},
_ => e,
})