Skip to content

Commit 5926c87

Browse files
authored
wasm-bindgen-webidl: use clap instead of structopt (#4219)
structopt is unmaintained, it uses very old version of clap, which pulls some old dependencies
1 parent 9f17635 commit 5926c87

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

crates/webidl/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ version = "0.0.0"
77

88
[dependencies]
99
anyhow = "1.0"
10+
clap = { version = "4.5", features = ["derive"] }
1011
env_logger = "0.11.5"
1112
heck = "0.5"
1213
lazy_static = "1.4.0"
@@ -15,7 +16,6 @@ once_cell = "1.12"
1516
proc-macro2 = "1.0"
1617
quote = '1.0'
1718
sourcefile = "0.2"
18-
structopt = "0.3.9"
1919
syn = { version = '2.0', features = ['extra-traits', 'full'] }
2020
wasm-bindgen-backend = { path = "../backend" }
2121
weedle = { git = "https://github.com/rustwasm/weedle.git" }

crates/webidl/src/main.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,30 @@
11
mod update_cargo_toml;
22

33
use anyhow::Result;
4+
use clap::Parser;
45
use std::path::PathBuf;
5-
use structopt::StructOpt;
66
use update_cargo_toml::update_cargo_toml_features;
77

8-
#[derive(StructOpt, Debug)]
8+
#[derive(Parser, Debug)]
99
#[structopt(
1010
name = "wasm-bindgen-webidl",
1111
about = "Converts WebIDL into wasm-bindgen compatible code."
1212
)]
1313
struct Opt {
14-
#[structopt(parse(from_os_str))]
1514
input_dir: PathBuf,
1615

17-
#[structopt(parse(from_os_str))]
1816
output_dir: PathBuf,
1917

20-
#[structopt(long)]
18+
#[clap(long)]
2119
no_features: bool,
2220

23-
#[structopt(parse(from_os_str))]
2421
cargo_toml_path: Option<PathBuf>,
2522
}
2623

2724
fn main() -> Result<()> {
2825
env_logger::init();
2926

30-
let opt = Opt::from_args();
27+
let opt = Opt::parse();
3128

3229
let features = !opt.no_features;
3330

0 commit comments

Comments
 (0)