Update to clap 3.* (#4082)

* Update to clap 3.0

This commit migrates all CLI commands internally used in this project
from structopt/clap2 to clap 3. The intent here is to ensure that we're
using maintained versions of the dependencies as structopt and clap 2
are less maintained nowadays. Most transitions were pretty
straightforward and mostly dealing with structopt/clap3 differences.

* Fix a number of `cargo deny` errors

This commit fixes a few errors around duplicate dependencies which
arose from the prior update to clap3. This also uses a new feature in
`deny.toml`, `skip-tree`, which allows having a bit more targeted
ignores for skips of duplicate version checks. This showed a few more
locations in Wasmtime itself where we could update some dependencies.
This commit is contained in:
Alex Crichton
2022-04-28 12:47:12 -05:00
committed by GitHub
parent 871a9d93f2
commit 5fe06f7345
30 changed files with 295 additions and 325 deletions

View File

@@ -1,11 +1,11 @@
use crate::utils::parse_sets_and_triple;
use anyhow::{Context as _, Result};
use clap::Parser;
use cranelift_codegen::Context;
use cranelift_wasm::{DummyEnvironment, ReturnMode};
use rayon::iter::{IntoParallelIterator, ParallelIterator};
use std::path::{Path, PathBuf};
use std::{fs, io};
use structopt::StructOpt;
static WASM_MAGIC: &[u8] = &[0x00, 0x61, 0x73, 0x6D];
@@ -13,22 +13,21 @@ static WASM_MAGIC: &[u8] = &[0x00, 0x61, 0x73, 0x6D];
///
/// Candidates are emitted in Souper's text format:
/// <https://github.com/google/souper>
#[derive(StructOpt)]
#[derive(Parser)]
pub struct Options {
/// Specify an input file to be used. Use '-' for stdin.
#[structopt(parse(from_os_str))]
input: PathBuf,
/// Specify the output file to be used. Use '-' for stdout.
#[structopt(short("o"), long("output"), default_value("-"), parse(from_os_str))]
#[clap(short, long, default_value("-"))]
output: PathBuf,
/// Configure Cranelift settings
#[structopt(long("set"))]
#[clap(long = "set")]
settings: Vec<String>,
/// Specify the Cranelift target
#[structopt(long("target"))]
#[clap(long = "target")]
target: String,
}