diff options
author | metamuffin <metamuffin@disroot.org> | 2023-10-24 20:04:19 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-10-24 20:04:19 +0200 |
commit | 5ee01d06c0b067f2f07d0288c499897cd0df29f7 (patch) | |
tree | 91dd323219a2102770d40919d5e713b03f48b1e5 /tool/src/main.rs | |
parent | d9b3b92e8ddd27aac39269a03a0eeb18e3a62a6a (diff) | |
download | jellything-5ee01d06c0b067f2f07d0288c499897cd0df29f7.tar jellything-5ee01d06c0b067f2f07d0288c499897cd0df29f7.tar.bz2 jellything-5ee01d06c0b067f2f07d0288c499897cd0df29f7.tar.zst |
migration tool
Diffstat (limited to 'tool/src/main.rs')
-rw-r--r-- | tool/src/main.rs | 16 |
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), } } |