From bbce03f95d82d5373f2b6a1c28b03eb25d7bb94c Mon Sep 17 00:00:00 2001 From: Naz Date: Sat, 11 Oct 2025 14:44:12 +0100 Subject: =?UTF-8?q?=E2=9C=A8feat:=20add=20flags=20to=20override=20values?= =?UTF-8?q?=20in=20config=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/args.rs | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src/args.rs') diff --git a/src/args.rs b/src/args.rs index 415d816..6998e15 100644 --- a/src/args.rs +++ b/src/args.rs @@ -1,4 +1,4 @@ -use clap::{Parser, Subcommand}; +use clap::{Args, Parser, Subcommand}; /// Simple bookmarks manager written in Rust #[derive(Debug, Parser)] @@ -12,5 +12,24 @@ pub struct Cli { pub enum Command { /// Start the web server to serve the bookmarks page #[command(name = "serv")] - Serv, + Serv(ServArgs), +} + +#[derive(Debug, Args)] +pub struct ServArgs { + // Port to listen to + #[arg(long = "port", short)] + pub port: Option, + + // Path to theme file + #[arg(long = "style", short)] + pub style_file: Option, + + // Path to bookmarks file + #[arg(long = "bookmarks", short)] + pub bookmarks_file: Option, + + // Path to favicon file + #[arg(long = "favicon", short)] + pub favicon_file: Option, } -- cgit v1.2.3