summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2018-04-08 22:21:19 +0200
committerGitHub <noreply@github.com>2018-04-08 22:21:19 +0200
commitc27dc79afe2ed2d978515dbcb737b0927783027b (patch)
treede3a6e46fa97947f590b2065a8782b7839f3f20d /lib
parent6bf9012aa8739e0f12749777766d7a3f8ab4d22b (diff)
parent16a76f6213f938eede88efd6e8ea1c9f944dfc59 (diff)
Merge pull request #1383 from matthiasbeyer/libimagrt/handler-exit-if-subcommand-not-found
libimagrt: 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 ccb70609..c0e8488f 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,
})