summaryrefslogtreecommitdiff
path: root/src/args.rs
diff options
context:
space:
mode:
authorNaz <ndpm13@ch-naseem.com>2025-10-11 14:44:12 +0100
committerNaz <ndpm13@ch-naseem.com>2025-10-12 09:54:00 +0100
commitbbce03f95d82d5373f2b6a1c28b03eb25d7bb94c (patch)
tree7439ed8038bbb9a08a6b56fbfb90e8bea4b9f2ea /src/args.rs
parent50cf5960cb1f0af831e28eb08b15b97794287f87 (diff)
✨feat: add flags to override values in config file
Diffstat (limited to 'src/args.rs')
-rw-r--r--src/args.rs23
1 files changed, 21 insertions, 2 deletions
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<String>,
+
+ // Path to theme file
+ #[arg(long = "style", short)]
+ pub style_file: Option<String>,
+
+ // Path to bookmarks file
+ #[arg(long = "bookmarks", short)]
+ pub bookmarks_file: Option<String>,
+
+ // Path to favicon file
+ #[arg(long = "favicon", short)]
+ pub favicon_file: Option<String>,
}