summaryrefslogtreecommitdiffstats
path: root/bin/domain/imag-bookmark
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-bookmark
parent140624ec5266095bde4c36480d19de742c676c2b (diff)
Handle unknown subcommands in binaries with Runtime::handle_unknown_subcommand
Diffstat (limited to 'bin/domain/imag-bookmark')
-rw-r--r--bin/domain/imag-bookmark/src/main.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/domain/imag-bookmark/src/main.rs b/bin/domain/imag-bookmark/src/main.rs
index 48f349c4..3438ee78 100644
--- a/bin/domain/imag-bookmark/src/main.rs
+++ b/bin/domain/imag-bookmark/src/main.rs
@@ -77,8 +77,12 @@ fn main() {
"collection" => collection(&rt),
"list" => list(&rt),
"remove" => remove(&rt),
- _ => {
- debug!("Unknown command"); // More error handling
+ other => {
+ debug!("Unknown command");
+ let _ = rt.handle_unknown_subcommand("imag-bookmark", other, rt.cli())
+ .map_err_trace_exit_unwrap(1)
+ .code()
+ .map(::std::process::exit);
},
}
});