use clap::{arg, Parser, ValueEnum}; use std::path::PathBuf; pub type Args = Action; #[derive(Parser)] #[clap(version, about)] /// Tool for administering a Jellything instance pub enum Action { /// Interactive wizard for adding new nodes Add { /// ID of the new node; inferred if not specified #[arg(short, long)] id: Option, /// Path to the media of this node. #[arg(short, long)] media: Option, /// Path of the new node within the library #[arg(short, long)] library_path: Option, }, /// Migrate the database by export or import to JSON Migrate { /// Database path as specified in the configuration database: PathBuf, /// Whether to import or export mode: MigrateMode, /// Location of the database in its exported form save_location: PathBuf, }, /// Issue a reimport via the API Reimport { /// Custom hostname, the config's is used by default #[arg(long)] hostname: Option, /// Disable TLS. Dont use this. #[arg(long)] no_tls: bool, }, } #[derive(Debug, Clone, Copy, PartialEq, ValueEnum)] pub enum MigrateMode { /// Import from JSON Import, /// Export to JSON Export, }