Add config printing, explain mode, completions, and docs
This commit is contained in:
33
src/cli.rs
33
src/cli.rs
@@ -2,13 +2,13 @@ use std::path::PathBuf;
|
||||
use std::str::FromStr;
|
||||
|
||||
use clap::{Parser, ValueEnum};
|
||||
use serde::Deserialize;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
#[command(name = "mov-renamarr", version, about = "Rename movie files into Radarr-compatible naming")]
|
||||
pub struct Cli {
|
||||
#[arg(long, value_name = "DIR")]
|
||||
pub input: PathBuf,
|
||||
#[arg(long, value_name = "DIR", required_unless_present_any = ["completions"])]
|
||||
pub input: Option<PathBuf>,
|
||||
|
||||
#[arg(long, value_name = "DIR")]
|
||||
pub output: Option<PathBuf>,
|
||||
@@ -34,6 +34,9 @@ pub struct Cli {
|
||||
#[arg(long)]
|
||||
pub dry_run: bool,
|
||||
|
||||
#[arg(long)]
|
||||
pub dry_run_summary: bool,
|
||||
|
||||
#[arg(long = "move", conflicts_with = "rename_in_place")]
|
||||
pub move_files: bool,
|
||||
|
||||
@@ -102,11 +105,20 @@ pub struct Cli {
|
||||
#[arg(long, alias = "offline")]
|
||||
pub no_lookup: bool,
|
||||
|
||||
#[arg(long)]
|
||||
pub explain: bool,
|
||||
|
||||
#[arg(long)]
|
||||
pub print_config: bool,
|
||||
|
||||
#[arg(long, value_enum)]
|
||||
pub completions: Option<CompletionShell>,
|
||||
|
||||
#[arg(long)]
|
||||
pub verbose: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, ValueEnum, Eq, PartialEq, Deserialize)]
|
||||
#[derive(Clone, Debug, ValueEnum, Eq, PartialEq, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum ProviderChoice {
|
||||
Auto,
|
||||
@@ -115,7 +127,7 @@ pub enum ProviderChoice {
|
||||
Both,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, ValueEnum, Eq, PartialEq, Deserialize)]
|
||||
#[derive(Clone, Debug, ValueEnum, Eq, PartialEq, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum ReportFormat {
|
||||
Text,
|
||||
@@ -123,7 +135,7 @@ pub enum ReportFormat {
|
||||
Csv,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, ValueEnum, Eq, PartialEq, Deserialize)]
|
||||
#[derive(Clone, Debug, ValueEnum, Eq, PartialEq, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum ColorMode {
|
||||
Auto,
|
||||
@@ -131,7 +143,7 @@ pub enum ColorMode {
|
||||
Never,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, ValueEnum, Eq, PartialEq, Deserialize)]
|
||||
#[derive(Clone, Debug, ValueEnum, Eq, PartialEq, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum LlmMode {
|
||||
Off,
|
||||
@@ -139,6 +151,13 @@ pub enum LlmMode {
|
||||
Assist,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, ValueEnum, Eq, PartialEq)]
|
||||
pub enum CompletionShell {
|
||||
Bash,
|
||||
Zsh,
|
||||
Fish,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub enum JobsArg {
|
||||
Auto,
|
||||
|
||||
Reference in New Issue
Block a user