From efb88b6dc0023d69fe0dfbe96c0828cf52930972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolphe=20Br=C3=A9ard?= Date: Sun, 26 Mar 2023 21:57:01 +0200 Subject: [PATCH] Add cryptoperiod to the CLI --- src/config.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/config.rs b/src/config.rs index 9176d22..7789edd 100644 --- a/src/config.rs +++ b/src/config.rs @@ -4,6 +4,7 @@ use clap::Parser; use std::collections::HashSet; use std::fs::File; use std::io::{BufRead, BufReader}; +use std::num::NonZeroU64; use std::path::PathBuf; #[derive(Parser, Debug)] @@ -21,6 +22,8 @@ pub struct Config { header: Vec, #[arg(short = 'o', long)] header_optional: Vec, + #[arg(short = 'p', long, default_value_t = NonZeroU64::new(15552000).unwrap())] + cryptoperiod: NonZeroU64, #[arg(short, long, value_name = "FILE")] revocation_list: Option, #[arg(short = 'x', long, default_value_t = 1296000)] @@ -46,6 +49,10 @@ impl Config { self.canonicalization } + pub fn cryptoperiod(&self) -> NonZeroU64 { + self.cryptoperiod + } + pub fn domains(&self) -> &[String] { &self.domain }