aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index c1e3268..3bd25d5 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -12,15 +12,20 @@ mod service;
12use service::shortner_service; 12use service::shortner_service;
13 13
14mod cli; 14mod cli;
15use cli::{CONFIG, HELP_TEXT}; 15use cli::{version, CONFIG, HELP_TEXT};
16 16
17fn main() -> Result<()> { 17fn main() -> Result<()> {
18 pretty_env_logger::init(); 18 pretty_env_logger::init();
19 19
20 if CONFIG.help { 20 if CONFIG.help {
21 version();
21 println!("{}", HELP_TEXT); 22 println!("{}", HELP_TEXT);
22 return Ok(()); 23 return Ok(());
23 } 24 }
25 if CONFIG.version {
26 version();
27 return Ok(());
28 }
24 29
25 init_db(&CONFIG.db_path)?; 30 init_db(&CONFIG.db_path)?;
26 smol::run(async { 31 smol::run(async {