diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 7 |
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; | |||
12 | use service::shortner_service; | 12 | use service::shortner_service; |
13 | 13 | ||
14 | mod cli; | 14 | mod cli; |
15 | use cli::{CONFIG, HELP_TEXT}; | 15 | use cli::{version, CONFIG, HELP_TEXT}; |
16 | 16 | ||
17 | fn main() -> Result<()> { | 17 | fn 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 { |