From 1576a990fe987468f7816778f9aa02c8a12db44d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolphe=20Br=C3=A9ard?= Date: Sun, 26 Mar 2023 22:12:50 +0200 Subject: [PATCH] Reorder the config members and functions based on the short parameter --- src/config.rs | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/config.rs b/src/config.rs index 13bd2f3..c7092f0 100644 --- a/src/config.rs +++ b/src/config.rs @@ -30,10 +30,10 @@ pub struct Config { revocation: u64, #[arg(short = 'u', long)] dns_update_cmd: String, - #[arg(short = 'x', long, default_value_t = 1296000)] - expiration: u64, #[arg(short, long, action = clap::ArgAction::Count)] verbose: u8, + #[arg(short = 'x', long, default_value_t = 1296000)] + expiration: u64, } impl Config { @@ -53,26 +53,10 @@ impl Config { self.canonicalization } - pub fn cryptoperiod(&self) -> NonZeroU64 { - self.cryptoperiod - } - - pub fn dns_update_cmd(&self) -> &str { - &self.dns_update_cmd - } - pub fn domains(&self) -> &[String] { &self.domain } - pub fn expiration(&self) -> Option { - if self.expiration != 0 { - Some(self.expiration) - } else { - None - } - } - pub fn headers(&self) -> &[String] { &self.header } @@ -81,13 +65,29 @@ impl Config { &self.header_optional } + pub fn cryptoperiod(&self) -> NonZeroU64 { + self.cryptoperiod + } + pub fn revocation(&self) -> u64 { self.revocation } + pub fn dns_update_cmd(&self) -> &str { + &self.dns_update_cmd + } + pub fn verbosity(&self) -> log::LevelFilter { crate::logs::log_level(self.verbose) } + + pub fn expiration(&self) -> Option { + if self.expiration != 0 { + Some(self.expiration) + } else { + None + } + } } fn process_domains(lst: &[String], domain_file: &Option) -> Result, String> {