From a1c60b95e831de65339151f47b4bae6fd43bce41 Mon Sep 17 00:00:00 2001 From: Keuin Date: Wed, 30 Mar 2022 22:28:17 +0800 Subject: Support command-line parameters. - `--help`: print help menu. - `--config`: specify which config file to use. - `--version`: print version and exit. --- src/main.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 4c58eaf..34d6465 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,6 +4,7 @@ use std::convert::Infallible; use std::net::{SocketAddr, ToSocketAddrs}; use std::str::FromStr; +use clap::Parser; use teloxide::prelude2::*; use tracing::{debug, info, Level}; use tracing::instrument; @@ -29,11 +30,21 @@ fn with_object(obj: T) -> impl Filter