diff --git a/src/main.rs b/src/main.rs index f1157a9..7f0dae6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,7 +2,7 @@ use serde_yaml; use serde::{Deserialize, Serialize}; use octocrab; use telegram_bot::*; -use clap::Clap; +use clap::Parser; use std::future::Future; use std::time::Duration; use futures; @@ -44,7 +44,8 @@ impl Repo { } -#[derive(Clap)] +#[derive(Parser, Debug)] +#[clap(author, version, about, long_about = None)] struct Opts { /// Config file #[clap(long, default_value = "config.yaml")] @@ -65,8 +66,8 @@ struct Opts { #[clap(long, allow_hyphen_values(true))] chatid: i64, /// Verbose level, accept multiple occurrences - #[clap(short, long, parse(from_occurrences))] - verbose: usize, + #[clap(short, long, action = clap::ArgAction::Count)] + verbose: u8, } #[tokio::main] @@ -74,7 +75,7 @@ async fn main() -> Result<(), Box> { let opts: Opts = Opts::parse(); stderrlog::new() .module(module_path!()) - .verbosity(opts.verbose+1) + .verbosity(usize::from(opts.verbose+1)) .timestamp(stderrlog::Timestamp::Second) .quiet(false) .init()