summaryrefslogtreecommitdiff
path: root/src/args.rs
blob: 6998e15df1fc78033c0fb89afaf4618c4a68552d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use clap::{Args, Parser, Subcommand};

/// Simple bookmarks manager written in Rust
#[derive(Debug, Parser)]
#[command(version, about, long_about = None)]
pub struct Cli {
    #[command(subcommand)]
    pub command: Command,
}

#[derive(Debug, Subcommand)]
pub enum Command {
    /// Start the web server to serve the bookmarks page
    #[command(name = "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>,
}