aboutsummaryrefslogtreecommitdiff
path: root/tool/src/cli.rs
blob: d13d57552b5457ccd013d455eec550fc4a9e11cb (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
36
37
38
39
use clap::{arg, Parser, Subcommand, ValueEnum};
use std::path::PathBuf;

#[derive(Parser)]
pub struct Args {
    #[clap(subcommand)]
    pub action: Action,
}

#[derive(Subcommand)]
pub enum Action {
    Add {
        #[arg(short, long)]
        id: Option<String>,
        #[arg(short, long)]
        media: Option<PathBuf>,
        #[arg(short, long)]
        library_path: Option<PathBuf>,
    },
    Migrate {
        database: PathBuf,
        mode: MigrateMode,
        save_location: PathBuf,
    },
    Reimport {
        /// Custom hostname, the config's is used by default
        #[arg(long)]
        hostname: Option<String>,
        /// Disable TLS. Dont use this.
        #[arg(long)]
        no_tls: bool,
    },
}

#[derive(Debug, Clone, Copy, PartialEq, ValueEnum)]
pub enum MigrateMode {
    Import,
    Export,
}