Skip to content

Commit bbe0756

Browse files
Updated 'test-services' to remove 'clap-v2'
Signed-off-by: Abhijit Gadgil <agadgil@progress.com>
1 parent 2849105 commit bbe0756

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

test-services/test-probe/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ workspace = "../../"
88
[dependencies]
99
actix-rt = "*"
1010
actix-web = { version = "*", default-features = false, features = [ "rustls-0_21" ] }
11-
clap = { git = "https://github.com/habitat-sh/clap.git", branch = "v2-master", features = [ "suggestions", "color", "unstable" ] }
11+
clap = { version = "4", features = ["env", "derive", "string", "wrap_help"] }
1212
serde = { version = "*", features = ["derive"] }
1313
serde_json = "*"
1414
toml = "*"

test-services/test-probe/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl Default for Config {
2626
}
2727

2828
pub fn from_matches(args: &ArgMatches) -> Result<Config> {
29-
if let Some(path) = args.value_of("config") {
29+
if let Some(path) = args.get_one::<String>("config") {
3030
let contents = fs::read_to_string(path)?;
3131
toml::from_str(&contents).map_err(Error::Toml)
3232
} else {

test-services/test-probe/src/main.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ use actix_web::{web::{self,
22
Data},
33
App as ActixApp,
44
HttpServer};
5-
use clap::{App,
6-
Arg};
5+
use clap::{Arg,
6+
Command};
77

88
mod config;
99
mod context;
1010
mod error;
1111

12-
fn app<'a, 'b>() -> App<'a, 'b> {
13-
App::new("test-probe").arg(Arg::with_name("config").short("c")
14-
.long("config")
15-
.value_name("CONFIG")
16-
.help("Sets a custom config file")
17-
.takes_value(true))
12+
fn app() -> Command {
13+
Command::new("test-probe").arg(Arg::new("config").short('c')
14+
.long("config")
15+
.value_name("CONFIG")
16+
.help("Sets a custom config file")
17+
.num_args(1))
1818
}
1919

2020
#[actix_rt::main]

0 commit comments

Comments
 (0)