Skip to content

Commit

Permalink
Switch from structopt to clap (#561)
Browse files Browse the repository at this point in the history
The new `clap` version supersedes `structopt`. Additionally this gets
rid of `ansi_term` as an indirect dependency, which is unmaintained.
  • Loading branch information
CryZe authored Sep 16, 2022
1 parent 89b3cb9 commit 79d9dab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion capi/bind_gen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ edition = "2018"

[dependencies]
heck = "0.4.0"
structopt = "0.3.7"
clap = { version = "3.2.21", features = ["derive"] }
syn = { version = "1.0.2", default-features = false, features = ["parsing", "full", "printing"] }
10 changes: 5 additions & 5 deletions capi/bind_gen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ mod typescript;
mod wasm;
mod wasm_bindgen;

use clap::Parser;
use std::{
collections::BTreeMap,
fs::{self, create_dir_all, remove_dir_all, File},
io::{BufWriter, Read, Result},
path::PathBuf,
rc::Rc,
};
use structopt::StructOpt;
use syn::{
parse_file, FnArg, Item, ItemFn, Lit, Meta, Pat, ReturnType, Signature, Type as SynType,
Visibility,
};

#[derive(StructOpt)]
#[structopt(about = "Generates bindings for livesplit-core")]
#[derive(clap::Parser)]
#[clap(about = "Generates bindings for livesplit-core")]
pub struct Opt {
#[structopt(
#[clap(
long = "ruby-lib-path",
help = "The path of the library for the Ruby bindings",
default_value = "../liblivesplit_core.so"
Expand Down Expand Up @@ -167,7 +167,7 @@ fn get_comment(attrs: &[syn::Attribute]) -> Vec<String> {
}

fn main() {
let opt = Opt::from_args();
let opt = Opt::parse();

let mut contents = fs::read_to_string("../src/lib.rs").unwrap();
let file = parse_file(&contents).unwrap();
Expand Down

0 comments on commit 79d9dab

Please sign in to comment.