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 5cd3492..c1e3268 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -12,11 +12,16 @@ mod service;
12use service::shortner_service; 12use service::shortner_service;
13 13
14mod cli; 14mod cli;
15use cli::CONFIG; 15use cli::{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 {
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();