diff options
author | Daniel Silverstone <dsilvers+gitlab@digital-scurf.org> | 2021-08-24 08:10:17 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers+gitlab@digital-scurf.org> | 2021-08-24 08:10:17 +0000 |
commit | 88679dd39cc6803a803b48eb35d6d13bfc19da5e (patch) | |
tree | c7efdcaaa51ccf149b89703f5551a3af83d70b8e /src/bin/jt.rs | |
parent | d73806f722113116d7a5b7886df2b7d5ccb34cda (diff) | |
parent | 0235721852dbddea8a306ba3be1d38a82a9fbb79 (diff) | |
download | jt2-88679dd39cc6803a803b48eb35d6d13bfc19da5e.tar.gz |
Merge branch 'rename' into 'main'
feat! rename binary from jt2 to jt
See merge request larswirzenius/jt!22
Diffstat (limited to 'src/bin/jt.rs')
-rw-r--r-- | src/bin/jt.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/bin/jt.rs b/src/bin/jt.rs new file mode 100644 index 0000000..11fc45d --- /dev/null +++ b/src/bin/jt.rs @@ -0,0 +1,29 @@ +use jt::config::Configuration; +use jt::opt::{Opt, SubCommand}; + +use structopt::StructOpt; + +fn main() { + if let Err(err) = do_work() { + eprintln!("ERROR: {:?}", err); + std::process::exit(1); + } +} + +fn do_work() -> anyhow::Result<()> { + pretty_env_logger::init_custom_env("JT_LOG"); + let opt = Opt::from_args(); + let config = Configuration::read(&opt)?; + match opt.cmd { + SubCommand::Config(x) => x.run(&config)?, + SubCommand::Init(x) => x.run(&config)?, + SubCommand::IsJournal(x) => x.run(&config)?, + SubCommand::New(x) => x.run(&config)?, + SubCommand::NewTopic(x) => x.run(&config)?, + SubCommand::List(x) => x.run(&config)?, + SubCommand::Edit(x) => x.run(&config)?, + SubCommand::Remove(x) => x.run(&config)?, + SubCommand::Finish(x) => x.run(&config)?, + } + Ok(()) +} |