Skip to content

Commit

Permalink
chore: update direct usage of clap to v4
Browse files Browse the repository at this point in the history
  • Loading branch information
bmwill committed Aug 29, 2023
1 parent 41a8eff commit 0c9bb9c
Show file tree
Hide file tree
Showing 52 changed files with 327 additions and 238 deletions.
76 changes: 44 additions & 32 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,7 @@ cached = "0.43.0"
camino = "1.1.1"
cfg-if = "1.0.0"
chrono = { version = "0.4.26", features = ["clock", "serde"] }
clap = { version = "3.2.17", features = ["derive", "cargo"] }
# clap = { version = "4.3.2", features = ["derive"] }
clap = { version = "4.3.2", features = ["derive", "wrap_help"] }
collectable = "0.0.2"
colored = "2.0.0"
comfy-table = "6.1.3"
Expand Down
2 changes: 1 addition & 1 deletion crates/sui-benchmark/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub struct Opts {
pub local: bool,
/// Required in remote benchmark, namely when local = false
/// Multiple fullnodes can be specified.
#[clap(long, multiple_values = true, value_delimiter = ',', global = true)]
#[clap(long, num_args(1..), value_delimiter = ',', global = true)]
pub fullnode_rpc_addresses: Vec<String>,
/// Whether to submit transactions to a fullnode.
/// If true, use FullNodeProxy.
Expand Down
1 change: 0 additions & 1 deletion crates/sui-cluster-test/src/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

use super::config::{ClusterTestOpt, Env};
use async_trait::async_trait;
use clap::*;
use std::net::SocketAddr;
use std::path::Path;
use sui_config::Config;
Expand Down
4 changes: 2 additions & 2 deletions crates/sui-cluster-test/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::path::PathBuf;
// SPDX-License-Identifier: Apache-2.0
use clap::*;

#[derive(Parser, Clone, ArgEnum)]
#[derive(Parser, Clone, ValueEnum)]
pub enum Env {
Devnet,
Staging,
Expand All @@ -18,7 +18,7 @@ pub enum Env {
#[derive(Parser)]
#[clap(name = "", rename_all = "kebab-case")]
pub struct ClusterTestOpt {
#[clap(arg_enum)]
#[clap(value_enum)]
pub env: Env,
#[clap(long)]
pub faucet_address: Option<String>,
Expand Down
1 change: 0 additions & 1 deletion crates/sui-cluster-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// SPDX-License-Identifier: Apache-2.0
use crate::faucet::{FaucetClient, FaucetClientFactory};
use async_trait::async_trait;
use clap::*;
use cluster::{Cluster, ClusterFactory};
use config::ClusterTestOpt;
use futures::{stream::FuturesUnordered, StreamExt};
Expand Down
4 changes: 2 additions & 2 deletions crates/sui-core/src/generate_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ fn get_registry() -> Result<Registry> {
tracer.registry()
}

#[derive(Debug, Parser, Clone, Copy, ArgEnum)]
#[derive(Debug, Parser, Clone, Copy, ValueEnum)]
enum Action {
Print,
Test,
Expand All @@ -177,7 +177,7 @@ enum Action {
about = "Trace serde (de)serialization to generate format descriptions for Sui types"
)]
struct Options {
#[clap(arg_enum, default_value = "Print", ignore_case = true)]
#[clap(value_enum, default_value = "Print", ignore_case = true)]
action: Action,
}

Expand Down
Loading

0 comments on commit 0c9bb9c

Please sign in to comment.