Skip to content

Commit e51632f

Browse files
authored
Merge pull request #2046 from Kobzol/replace-structopt-with-clap
Replace structopt with clap
2 parents be9366f + c6e3081 commit e51632f

File tree

3 files changed

+118
-84
lines changed

3 files changed

+118
-84
lines changed

Cargo.lock

Lines changed: 113 additions & 79 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ ignore = "0.4.18"
4444
postgres-types = { version = "0.2.4", features = ["derive"] }
4545
cron = { version = "0.15.0" }
4646
bytes = "1.1.0"
47-
structopt = "0.3.26"
47+
clap = { version = "4", features = ["derive"] }
4848
hmac = "0.12.1"
4949
subtle = "2.6.1"
5050
sha2 = "0.10.9"

src/bin/project_goals.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
use structopt::StructOpt;
1+
use clap::Parser;
22
use triagebot::zulip::client::ZulipClient;
33
use triagebot::{github::GithubClient, handlers::project_goals};
44

55
/// A basic example
6-
#[derive(StructOpt, Debug)]
6+
#[derive(Parser, Debug)]
77
struct Opt {
88
/// If specified, no messages are sent.
9-
#[structopt(long)]
9+
#[arg(long)]
1010
dry_run: bool,
1111

1212
/// Goals with an updated within this threshold will not be pinged.
@@ -21,7 +21,7 @@ async fn main() -> anyhow::Result<()> {
2121
dotenvy::dotenv().ok();
2222
tracing_subscriber::fmt::init();
2323

24-
let opt = Opt::from_args();
24+
let opt = Opt::parse();
2525
let gh = GithubClient::new_from_env();
2626
let zulip = ZulipClient::new_from_env();
2727
project_goals::ping_project_goals_owners(

0 commit comments

Comments
 (0)