summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/jt2.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/bin/jt2.rs b/src/bin/jt2.rs
index 8ef0728..a8fe6c1 100644
--- a/src/bin/jt2.rs
+++ b/src/bin/jt2.rs
@@ -3,7 +3,17 @@ use jt2::opt::{Opt, SubCommand};
use structopt::StructOpt;
-fn main() -> anyhow::Result<()> {
+fn main() {
+ match do_work() {
+ Err(err) => {
+ eprintln!("ERROR: {:?}", err);
+ std::process::exit(1);
+ }
+ Ok(_) => (),
+ }
+}
+
+fn do_work() -> anyhow::Result<()> {
pretty_env_logger::init_custom_env("JT_LOG");
let opt = Opt::from_args();
let config = Configuration::read(&opt)?;