From 7ca05e92b993118d96d04ede2296b2a44a21a53f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolphe=20Br=C3=A9ard?= Date: Sun, 26 Mar 2023 17:21:20 +0200 Subject: [PATCH] Add expiration to the CLI --- src/config.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/config.rs b/src/config.rs index 492dbcc..aa766fb 100644 --- a/src/config.rs +++ b/src/config.rs @@ -20,6 +20,8 @@ pub struct Config { domain_file: Option, #[arg(short, long, value_name = "FILE")] revocation_list: Option, + #[arg(short = 'x', long, default_value_t = 1296000)] + expiration: u64, } impl Config { @@ -51,4 +53,12 @@ impl Config { pub fn domains(&self) -> &[String] { &self.domain } + + pub fn expiration(&self) -> Option { + if self.expiration != 0 { + Some(self.expiration) + } else { + None + } + } }