summaryrefslogtreecommitdiffstats
path: root/bin/domain/imag-log/src/main.rs
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2018-04-04 17:01:02 +0200
committerMatthias Beyer <mail@beyermatthias.de>2018-04-04 19:34:13 +0200
commit8c1b4124c0261f9e131747f730c4ced4dc1257a6 (patch)
tree1daaf007c06fde2d554ac0dd69e6ba52eab191e0 /bin/domain/imag-log/src/main.rs
parent140624ec5266095bde4c36480d19de742c676c2b (diff)
Handle unknown subcommands in binaries with Runtime::handle_unknown_subcommand
Diffstat (limited to 'bin/domain/imag-log/src/main.rs')
-rw-r--r--bin/domain/imag-log/src/main.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/domain/imag-log/src/main.rs b/bin/domain/imag-log/src/main.rs
index 7c2804ec..bc5a6a74 100644
--- a/bin/domain/imag-log/src/main.rs
+++ b/bin/domain/imag-log/src/main.rs
@@ -72,9 +72,12 @@ fn main() {
if let Some(scmd) = rt.cli() .subcommand_name() {
match scmd {
"show" => show(&rt),
- _ => {
- error!("Unknown command");
- ::std::process::exit(1)
+ other => {
+ debug!("Unknown command");
+ let _ = rt.handle_unknown_subcommand("imag-log", other, rt.cli())
+ .map_err_trace_exit_unwrap(1)
+ .code()
+ .map(std::process::exit);
},
}
} else {