diff options
author | metamuffin <metamuffin@disroot.org> | 2024-04-17 01:00:05 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-04-17 01:00:05 +0200 |
commit | 8b5a531417d7cc503cb4b50c4b64b49b5815ed99 (patch) | |
tree | 279dcb91feb9d5183d066ef501709e30ca126b84 /tool | |
parent | ddf52f02d66abfee17a4105503220a9a34064f29 (diff) | |
download | jellything-8b5a531417d7cc503cb4b50c4b64b49b5815ed99.tar jellything-8b5a531417d7cc503cb4b50c4b64b49b5815ed99.tar.bz2 jellything-8b5a531417d7cc503cb4b50c4b64b49b5815ed99.tar.zst |
tool: doc all options
Diffstat (limited to 'tool')
-rw-r--r-- | tool/src/cli.rs | 23 | ||||
-rw-r--r-- | tool/src/main.rs | 2 |
2 files changed, 17 insertions, 8 deletions
diff --git a/tool/src/cli.rs b/tool/src/cli.rs index d13d575..2e12c81 100644 --- a/tool/src/cli.rs +++ b/tool/src/cli.rs @@ -1,27 +1,34 @@ -use clap::{arg, Parser, Subcommand, ValueEnum}; +use clap::{arg, Parser, ValueEnum}; use std::path::PathBuf; -#[derive(Parser)] -pub struct Args { - #[clap(subcommand)] - pub action: Action, -} +pub type Args = Action; -#[derive(Subcommand)] +#[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<String>, + /// Path to the media of this node. #[arg(short, long)] media: Option<PathBuf>, + /// Path of the new node within the library #[arg(short, long)] library_path: Option<PathBuf>, }, + /// 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)] @@ -34,6 +41,8 @@ pub enum Action { #[derive(Debug, Clone, Copy, PartialEq, ValueEnum)] pub enum MigrateMode { + /// Import from JSON Import, + /// Export to JSON Export, } diff --git a/tool/src/main.rs b/tool/src/main.rs index a896fa2..828ad9d 100644 --- a/tool/src/main.rs +++ b/tool/src/main.rs @@ -23,7 +23,7 @@ fn main() -> anyhow::Result<()> { .init(); let args = Args::parse(); - match args.action { + match args { a @ Action::Add { .. } => tokio::runtime::Builder::new_multi_thread() .enable_all() .build() |