Add expiration to the CLI

This commit is contained in:
Rodolphe Bréard 2023-03-26 17:21:20 +02:00
parent 3dba0451cd
commit 7ca05e92b9

View file

@ -20,6 +20,8 @@ pub struct Config {
domain_file: Option<PathBuf>,
#[arg(short, long, value_name = "FILE")]
revocation_list: Option<PathBuf>,
#[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<u64> {
if self.expiration != 0 {
Some(self.expiration)
} else {
None
}
}
}