Skip to content

Commit 4038e45

Browse files
Merge pull request #89 from CleverCloud/devel/fdubois/fix/clap-deprecated-usage-of-parse
Fix deprecated usage of `parse` attribute method for clap
2 parents 92fcf9b + f81d32e commit 4038e45

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/cmd/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use std::{io, net::AddrParseError, path::PathBuf, process::abort, sync::Arc};
55

66
use async_trait::async_trait;
7-
use clap::{Parser, Subcommand};
7+
use clap::{ArgAction, Parser, Subcommand};
88
use clevercloud_sdk::{
99
oauth10a::{
1010
connector::HttpsConnector,
@@ -96,8 +96,8 @@ impl Executor for Command {
9696
#[clap(author, version, about)]
9797
pub struct Args {
9898
/// Increase log verbosity
99-
#[clap(short = 'v', global = true, parse(from_occurrences))]
100-
pub verbosity: usize,
99+
#[clap(short = 'v', global = true, action = ArgAction::Count)]
100+
pub verbosity: u8,
101101
/// Specify location of kubeconfig
102102
#[clap(short = 'k', long = "kubeconfig", global = true)]
103103
pub kubeconfig: Option<PathBuf>,

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl From<opentelemetry::trace::TraceError> for Error {
7474
#[paw::main]
7575
#[tokio::main]
7676
pub(crate) async fn main(args: Args) -> Result<(), Error> {
77-
logging::initialize(args.verbosity)?;
77+
logging::initialize(args.verbosity as usize)?;
7878

7979
let config = Arc::new(match &args.config {
8080
Some(path) => Configuration::try_from(path.to_owned())?,

0 commit comments

Comments
 (0)