Skip to content

Commit

Permalink
wasm-bindgen-webidl: use clap instead of structopt (#4219)
Browse files Browse the repository at this point in the history
structopt is unmaintained, it uses very old version of clap, which pulls some old dependencies
  • Loading branch information
ognevny authored Oct 31, 2024
1 parent 9f17635 commit 5926c87
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion crates/webidl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ version = "0.0.0"

[dependencies]
anyhow = "1.0"
clap = { version = "4.5", features = ["derive"] }
env_logger = "0.11.5"
heck = "0.5"
lazy_static = "1.4.0"
Expand All @@ -15,7 +16,6 @@ once_cell = "1.12"
proc-macro2 = "1.0"
quote = '1.0'
sourcefile = "0.2"
structopt = "0.3.9"
syn = { version = '2.0', features = ['extra-traits', 'full'] }
wasm-bindgen-backend = { path = "../backend" }
weedle = { git = "https://github.com/rustwasm/weedle.git" }
11 changes: 4 additions & 7 deletions crates/webidl/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
mod update_cargo_toml;

use anyhow::Result;
use clap::Parser;
use std::path::PathBuf;
use structopt::StructOpt;
use update_cargo_toml::update_cargo_toml_features;

#[derive(StructOpt, Debug)]
#[derive(Parser, Debug)]
#[structopt(
name = "wasm-bindgen-webidl",
about = "Converts WebIDL into wasm-bindgen compatible code."
)]
struct Opt {
#[structopt(parse(from_os_str))]
input_dir: PathBuf,

#[structopt(parse(from_os_str))]
output_dir: PathBuf,

#[structopt(long)]
#[clap(long)]
no_features: bool,

#[structopt(parse(from_os_str))]
cargo_toml_path: Option<PathBuf>,
}

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

let opt = Opt::from_args();
let opt = Opt::parse();

let features = !opt.no_features;

Expand Down

0 comments on commit 5926c87

Please sign in to comment.