2025-03-18 03:05:18 +01:00
|
|
|
use clap::{ArgGroup, Parser};
|
|
|
|
|
use std::path::PathBuf;
|
|
|
|
|
|
|
|
|
|
/// Command-line interface für das Umbenennungsprogramm
|
|
|
|
|
#[derive(Parser, Debug, Clone)]
|
|
|
|
|
#[clap(about, version, author)]
|
|
|
|
|
#[clap(group(
|
|
|
|
|
ArgGroup::new("mode")
|
2026-02-10 10:11:59 +01:00
|
|
|
.args(&["dry_run", "force"])
|
2025-03-18 03:05:18 +01:00
|
|
|
.multiple(false)
|
|
|
|
|
))]
|
|
|
|
|
pub struct Cli {
|
|
|
|
|
/// Pfade (Dateien und Verzeichnisse) zum rekursiven Anpassen
|
|
|
|
|
pub paths: Vec<PathBuf>,
|
|
|
|
|
|
|
|
|
|
/// Ausgaben unterdrücken (keine Umbenennungsinfos auf stdout)
|
|
|
|
|
#[clap(short, long)]
|
|
|
|
|
pub quiet: bool,
|
|
|
|
|
|
2026-02-10 10:11:59 +01:00
|
|
|
/// Nur anzeigen, aber keine realen Änderungen vornehmen (dry-run)
|
|
|
|
|
#[clap(short = 'n', long = "dry-run", alias = "no-changes")]
|
|
|
|
|
pub dry_run: bool,
|
2025-03-18 03:05:18 +01:00
|
|
|
|
|
|
|
|
/// Existierende Dateien überschreiben
|
|
|
|
|
#[clap(short, long)]
|
|
|
|
|
pub force: bool,
|
|
|
|
|
|
|
|
|
|
/// Zu ignorierende Muster (-e "*.py", mehrere können angegeben werden)
|
|
|
|
|
#[clap(short = 'e', long, value_name = "PATTERN")]
|
|
|
|
|
pub exclude: Vec<String>,
|
|
|
|
|
|
|
|
|
|
/// Ausführliche Debug-Informationen
|
|
|
|
|
#[clap(short = 'v', long)]
|
|
|
|
|
pub verbose: bool,
|
|
|
|
|
|
|
|
|
|
/// Erlaubt, auch das Wurzelverzeichnis anzupassen
|
|
|
|
|
#[clap(long)]
|
|
|
|
|
pub modify_root: bool,
|
2026-02-10 10:11:59 +01:00
|
|
|
|
|
|
|
|
/// Auch symbolische Links und Special Files verarbeiten
|
|
|
|
|
#[clap(long)]
|
|
|
|
|
pub special: bool,
|
2025-03-18 03:05:18 +01:00
|
|
|
}
|