Merge pull request #1383 from matthiasbeyer/libimagrt/handler-exit-if-subcommand-not-found

libimagrt: Exit if handler does not find subcommand
This commit is contained in:
Matthias Beyer 2018-04-08 22:21:19 +02:00 committed by GitHub
commit c27dc79afe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,
})