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 5cd3492..c1e3268 100644 --- a/src/main.rs +++ b/src/main.rs | |||
@@ -12,11 +12,16 @@ mod service; | |||
12 | use service::shortner_service; | 12 | use service::shortner_service; |
13 | 13 | ||
14 | mod cli; | 14 | mod cli; |
15 | use cli::CONFIG; | 15 | use cli::{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 { | ||
21 | println!("{}", HELP_TEXT); | ||
22 | return Ok(()); | ||
23 | } | ||
24 | |||
20 | init_db(&CONFIG.db_path)?; | 25 | init_db(&CONFIG.db_path)?; |
21 | smol::run(async { | 26 | smol::run(async { |
22 | let addr = ([127, 0, 0, 1], CONFIG.port).into(); | 27 | let addr = ([127, 0, 0, 1], CONFIG.port).into(); |