- --dry-run als primäre Option (--no-changes als deprecated alias) - --special für Symlinks und Special Files - Smart Default-Excludes: .git, .svn, node_modules, .cache, __pycache__ werden automatisch ignoriert (ähnlich wie detox) - Alle Änderungen rückwärtskompatibel Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
43 lines
1.2 KiB
Rust
43 lines
1.2 KiB
Rust
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")
|
|
.args(&["dry_run", "force"])
|
|
.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,
|
|
|
|
/// Nur anzeigen, aber keine realen Änderungen vornehmen (dry-run)
|
|
#[clap(short = 'n', long = "dry-run", alias = "no-changes")]
|
|
pub dry_run: bool,
|
|
|
|
/// 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,
|
|
|
|
/// Auch symbolische Links und Special Files verarbeiten
|
|
#[clap(long)]
|
|
pub special: bool,
|
|
}
|