Browse Source

Use clap::Command instead of the deprecated clap::App

pull/57/head
Rodolphe Bréard 3 years ago
parent
commit
d8e7184b09
  1. 4
      acmed/src/main.rs
  2. 4
      tacd/src/main.rs

4
acmed/src/main.rs

@ -4,7 +4,7 @@ use acme_common::crypto::{
}; };
use acme_common::logs::{set_log_system, DEFAULT_LOG_LEVEL}; use acme_common::logs::{set_log_system, DEFAULT_LOG_LEVEL};
use acme_common::{clean_pid_file, init_server}; use acme_common::{clean_pid_file, init_server};
use clap::{App, Arg};
use clap::{Arg, Command};
use log::error; use log::error;
mod account; mod account;
@ -59,7 +59,7 @@ fn main() {
env!("ACMED_HTTP_LIB_VERSION") env!("ACMED_HTTP_LIB_VERSION")
); );
let default_log_level = DEFAULT_LOG_LEVEL.to_string().to_lowercase(); let default_log_level = DEFAULT_LOG_LEVEL.to_string().to_lowercase();
let matches = App::new(APP_NAME)
let matches = Command::new(APP_NAME)
.version(APP_VERSION) .version(APP_VERSION)
.long_version(full_version.as_str()) .long_version(full_version.as_str())
.arg( .arg(

4
tacd/src/main.rs

@ -7,7 +7,7 @@ use acme_common::crypto::{get_lib_name, get_lib_version, HashFunction, KeyType,
use acme_common::error::Error; use acme_common::error::Error;
use acme_common::logs::{set_log_system, DEFAULT_LOG_LEVEL}; use acme_common::logs::{set_log_system, DEFAULT_LOG_LEVEL};
use acme_common::{clean_pid_file, to_idna}; use acme_common::{clean_pid_file, to_idna};
use clap::{App, Arg, ArgMatches};
use clap::{Arg, ArgMatches, Command};
use log::{debug, error, info}; use log::{debug, error, info};
use std::fs::File; use std::fs::File;
use std::io::{self, Read}; use std::io::{self, Read};
@ -79,7 +79,7 @@ fn main() {
let default_crt_key_type = DEFAULT_CRT_KEY_TYPE.to_string(); let default_crt_key_type = DEFAULT_CRT_KEY_TYPE.to_string();
let default_crt_digest = DEFAULT_CRT_DIGEST.to_string(); let default_crt_digest = DEFAULT_CRT_DIGEST.to_string();
let default_log_level = DEFAULT_LOG_LEVEL.to_string().to_lowercase(); let default_log_level = DEFAULT_LOG_LEVEL.to_string().to_lowercase();
let matches = App::new(APP_NAME)
let matches = Command::new(APP_NAME)
.version(APP_VERSION) .version(APP_VERSION)
.long_version(full_version.as_str()) .long_version(full_version.as_str())
.arg( .arg(

Loading…
Cancel
Save