Skip to content

Commit

Permalink
Update to clap 4 (#84)
Browse files Browse the repository at this point in the history
Update to clap 4.0
  • Loading branch information
nyospe authored Oct 6, 2022
1 parent 482f59a commit 966c07f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ark-serialize = "0.3.0"
async-std = { version = "1.8.0", features = ["attributes"] }
async-trait = "0.1.51"
bincode = "1.3.3"
clap = { version = "3.2.5", features = ["derive"] }
clap = { version = "4.0", features = ["derive"] }
config = "0.13.1"
derive_more = "0.99"
dirs = "4.0.0"
Expand All @@ -42,7 +42,7 @@ snafu = { version = "0.7", features = ["backtraces"] }
strum = "0.20"
strum_macros = "0.20.1"
surf = "2.3.2"
tagged-base64 = { git = "https://github.com/EspressoSystems/tagged-base64.git", tag = "0.2.0" }
tagged-base64 = { git = "https://github.com/EspressoSystems/tagged-base64.git", tag = "0.2.1" }
tide = { version = "0.16.0", default-features = false }
tide-websockets = "0.4.0"
toml = "0.5"
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
use crate::ApiKey::*;
use async_std::sync::{Arc, RwLock};
use async_std::task::sleep;
use clap::{CommandFactory, Parser};
use clap::CommandFactory;
use config::{Config, ConfigError};
use routefinder::Router;
use serde::Deserialize;
Expand Down Expand Up @@ -281,7 +281,7 @@ pub const SERVER_STARTUP_RETRIES: u64 = 255;
/// Number of milliseconds to sleep between attempts
pub const SERVER_STARTUP_SLEEP_MS: u64 = 100;

#[derive(Parser, Debug)]
#[derive(clap::Args, Debug)]
#[clap(author, version, about, long_about = None)]
pub struct DiscoArgs {
#[clap(long)]
Expand Down Expand Up @@ -544,8 +544,8 @@ fn get_cmd_line_map<Args: CommandFactory>() -> config::Environment {
let mut cla = HashMap::new();
let matches = Args::command().get_matches();
for arg in Args::command().get_arguments() {
if let Some(value) = matches.get_one::<String>(arg.get_id()) {
let key = arg.get_id().replace('-', "_");
if let Some(value) = matches.get_one::<String>(arg.get_id().as_str()) {
let key = arg.get_id().as_str().replace('-', "_");
cla.insert(key, value.to_owned());
}
}
Expand Down

0 comments on commit 966c07f

Please sign in to comment.