summaryrefslogtreecommitdiff
path: root/bin/core/imag-store
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/core/imag-store
parent140624ec5266095bde4c36480d19de742c676c2b (diff)
downloadimag-8c1b4124c0261f9e131747f730c4ced4dc1257a6.zip
imag-8c1b4124c0261f9e131747f730c4ced4dc1257a6.tar.gz
Handle unknown subcommands in binaries with Runtime::handle_unknown_subcommand
Diffstat (limited to 'bin/core/imag-store')
-rw-r--r--bin/core/imag-store/src/main.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/core/imag-store/src/main.rs b/bin/core/imag-store/src/main.rs
index 60f80d1..5ec16ce 100644
--- a/bin/core/imag-store/src/main.rs
+++ b/bin/core/imag-store/src/main.rs
@@ -50,6 +50,7 @@ extern crate libimagutil;
extern crate libimagutil;
use libimagrt::setup::generate_runtime_setup;
+use libimagerror::trace::MapErrTrace;
mod create;
mod delete;
@@ -92,9 +93,12 @@ fn main() {
"update" => update(&rt),
"verify" => verify(&rt),
"dump" => dump(&mut rt),
- _ => {
+ other => {
debug!("Unknown command");
- // More error handling
+ let _ = rt.handle_unknown_subcommand("imag-store", other, rt.cli())
+ .map_err_trace_exit_unwrap(1)
+ .code()
+ .map(std::process::exit);
},
};
} else {