release: Version 0.2.0 mit Statistiken und CHANGELOG
- Version erhöht von 0.1.0 auf 0.2.0 - CHANGELOG.md hinzugefügt mit vollständiger Feature-Liste - Statistiken am Ende: Verarbeitete/geplante/umbenannte Dateien - Fehler-Zähler für übersprungene/fehlgeschlagene Umbenennungen - Kommentar-Klarstellung in sanitizer.rs - Bessere Fehlerbehandlung mit detaillierten Error-Messages Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
60a56ec021
commit
f4006ba99d
6 changed files with 88 additions and 15 deletions
49
src/main.rs
49
src/main.rs
|
|
@ -162,6 +162,12 @@ fn main() -> Result<()> {
|
|||
.collect()
|
||||
};
|
||||
|
||||
// Statistiken
|
||||
let total_processed = entries.len();
|
||||
let total_planned = rename_ops.len();
|
||||
let mut renamed_count = 0;
|
||||
let mut skipped_count = 0;
|
||||
|
||||
// Umbenennungen sequenziell ausführen
|
||||
for op in rename_ops {
|
||||
if let Some(bar) = &progress_bar {
|
||||
|
|
@ -176,19 +182,44 @@ fn main() -> Result<()> {
|
|||
debug!("Rename: {:?} -> {:?}", op.old_path, op.new_path);
|
||||
}
|
||||
|
||||
if !args.dry_run && is_safe_rename(&op.old_path, &op.new_path, args.force) {
|
||||
fs::rename(&op.old_path, &op.new_path).with_context(|| {
|
||||
format!(
|
||||
"Fehler beim Umbenennen: {} -> {}",
|
||||
op.old_path.display(),
|
||||
op.new_path.display()
|
||||
)
|
||||
})?;
|
||||
if !args.dry_run {
|
||||
if is_safe_rename(&op.old_path, &op.new_path, args.force) {
|
||||
match fs::rename(&op.old_path, &op.new_path) {
|
||||
Ok(_) => renamed_count += 1,
|
||||
Err(e) => {
|
||||
error!(
|
||||
"Fehler beim Umbenennen: {} -> {}: {}",
|
||||
op.old_path.display(),
|
||||
op.new_path.display(),
|
||||
e
|
||||
);
|
||||
skipped_count += 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
skipped_count += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(bar) = &progress_bar {
|
||||
bar.finish_with_message("Umbenennung abgeschlossen");
|
||||
bar.finish_with_message("Verarbeitung abgeschlossen");
|
||||
}
|
||||
|
||||
// Zusammenfassung ausgeben (außer im quiet mode)
|
||||
if !args.quiet {
|
||||
info!("");
|
||||
info!("=== Zusammenfassung für {} ===", path.display());
|
||||
info!("Verarbeitete Dateien/Verzeichnisse: {}", total_processed);
|
||||
info!("Umbenennungen geplant: {}", total_planned);
|
||||
if args.dry_run {
|
||||
info!("Modus: Dry-run (keine Änderungen)");
|
||||
} else {
|
||||
info!("Erfolgreich umbenannt: {}", renamed_count);
|
||||
if skipped_count > 0 {
|
||||
info!("Übersprungen/Fehler: {}", skipped_count);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -62,12 +62,12 @@ pub fn clean_filename(name: &OsStr, config: &Config, verbose: bool) -> Option<St
|
|||
base = preserve_special_identifiers(&base);
|
||||
ext = preserve_special_identifiers(&ext);
|
||||
|
||||
// 1) Konfig-Replacements zuerst
|
||||
// 1) Konfig-Replacements anwenden (zuerst)
|
||||
for (k, v) in &config.replacements {
|
||||
base = base.replace(k, v);
|
||||
}
|
||||
|
||||
// 2) Dann erst hart-codierte Ersetzungen anwenden
|
||||
// 2) Danach hart-codierte Ersetzungen anwenden
|
||||
base = apply_hardcoded_replacements(&base);
|
||||
|
||||
// 3) Emojis und hochgestellte Zeichen ersetzen
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue