From 79e8ac0a3670dbb898cbe756c13b36e8488992d7 Mon Sep 17 00:00:00 2001 From: Alexander Mohr Date: Tue, 27 May 2025 20:21:53 +0200 Subject: [PATCH] make version non option, fixes #22 --- worf/src/lib/config.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/worf/src/lib/config.rs b/worf/src/lib/config.rs index 21d362e..f3f94d5 100644 --- a/worf/src/lib/config.rs +++ b/worf/src/lib/config.rs @@ -186,7 +186,8 @@ pub struct Config { /// Prints the version and then exits #[clap(short = 'v', long = "version")] - version: Option, + #[serde(default = "default_false")] + version: bool, /// Defines the style sheet to be loaded. /// Defaults to `$XDG_CONF_DIR/worf/style.css` @@ -576,7 +577,7 @@ impl Config { #[must_use] pub fn version(&self) -> bool { - self.version.unwrap_or(false) + self.version } }