aboutsummaryrefslogtreecommitdiff
path: root/tool/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tool/src/main.rs')
-rw-r--r--tool/src/main.rs16
1 files changed, 15 insertions, 1 deletions
diff --git a/tool/src/main.rs b/tool/src/main.rs
index 1e84bda..3a670f5 100644
--- a/tool/src/main.rs
+++ b/tool/src/main.rs
@@ -6,12 +6,14 @@
#![feature(file_create_new)]
pub mod import;
+pub mod migrate;
use base64::Engine;
-use clap::{Parser, Subcommand};
+use clap::{Parser, Subcommand, ValueEnum};
use import::import;
use jellycommon::{config::GlobalConfig, Node, NodeKind, NodePrivate, NodePublic};
use log::{info, warn};
+use migrate::migrate;
use rand::random;
use std::{fmt::Debug, fs::File, io::Write, path::PathBuf};
@@ -61,6 +63,17 @@ enum Action {
#[arg(short, long)]
series: bool,
},
+ Migrate {
+ database: PathBuf,
+ mode: MigrateMode,
+ save_location: PathBuf,
+ },
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, ValueEnum)]
+enum MigrateMode {
+ Import,
+ Export,
}
fn main() -> anyhow::Result<()> {
@@ -123,6 +136,7 @@ fn main() -> anyhow::Result<()> {
Ok(())
}
a @ Action::New { .. } => import(a, args.dry),
+ a @ Action::Migrate { .. } => migrate(a),
}
}