diff --git a/Cargo.lock b/Cargo.lock index 5af4c1c..cf3ef08 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = 4 [[package]] name = "NameToUnix" -version = "1.2.0" +version = "1.2.1" dependencies = [ "anyhow", "assert_cmd", diff --git a/Cargo.toml b/Cargo.toml index 46e19da..4cefc26 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "NameToUnix" -version = "1.2.0" +version = "1.2.1" edition = "2021" authors = ["Dieter Schlüter "] description = "Ein Tool zum Anpassen von Verzeichnis- und Dateinamen an Linux-Konventionen" diff --git a/README.md b/README.md index dd27175..2ba3ea8 100644 --- a/README.md +++ b/README.md @@ -338,21 +338,28 @@ Ein Tool zum Anpassen von Verzeichnis- und Dateinamen an Linux-Konventionen Usage: ntu [OPTIONS] [PATHS]... Arguments: -[PATHS]... Pfade (Dateien und Verzeichnisse) zum rekursiven Anpassen + [PATHS]... Pfade (Dateien und Verzeichnisse) zum rekursiven Anpassen Options: --q, --quiet Ausgaben unterdrücken (keine Umbenennungsinfos auf stdout) --n, --dry-run Nur anzeigen, aber keine realen Änderungen vornehmen (dry-run) --f, --force Existierende Dateien überschreiben --e, --exclude Zu ignorierende Muster (-e "*.py", mehrere können angegeben werden) --v, --verbose Ausführliche Debug-Informationen - --modify-root Erlaubt, auch das Wurzelverzeichnis anzupassen - --special Auch symbolische Links und Special Files verarbeiten --h, --help Print help --V, --version Print version - + --conf Explizite Konfigurationsdatei (bypassed Standard-Hierarchie) + -r, --recursive Rekursive Verarbeitung von Unterverzeichnissen aktivieren + --max-depth Maximale Rekursionstiefe (erfordert --recursive) + -s, --sequence Wählt eine Transformations-Sequenz aus (default, lower, upper, minimal, utf-8) + -L Listet alle verfügbaren Sequences auf + -q, --quiet Ausgaben unterdrücken (keine Umbenennungsinfos auf stdout) + -n, --dry-run Nur anzeigen, aber keine realen Änderungen vornehmen (dry-run) + -f, --force Existierende Dateien überschreiben + -e, --exclude Zu ignorierende Muster (-e "*.py", mehrere können angegeben werden) + -v, --verbose Ausführliche Debug-Informationen + --modify-root Erlaubt, auch das Wurzelverzeichnis anzupassen + --special Auch symbolische Links und Special Files verarbeiten + --no-color Deaktiviert farbige Ausgabe + -h, --help Print help + -V, --version Print version ``` +Farbige Ausgabe kann auch über die Umgebungsvariable `NO_COLOR` deaktiviert werden (siehe https://no-color.org/). + ### Usage of NameToUnix ```text @@ -361,21 +368,28 @@ A tool for adapting directories and file names to Linux conventions Usage: ntu [OPTIONS] [PATHS]... Arguments: -[PATHS]... Paths (files and directories) for recursive customization + [PATHS]... Paths (files and directories) for recursive customization Options: --q, --quiet Suppress output (no renaming info on stdout) --n, --dry-run Only display, but do not make any real changes (dry-run) --f, --force Overwrite existing files --e, --exclude Patterns to be ignored (-e "*.py", several can be specified) --v, --verbose Detailed debug information - --modify-root Allows you to customize the root directory as well - --special Also process symbolic links and special files --h, --help Print help --V, --version Print version - + --conf Explicit config file (bypasses default hierarchy) + -r, --recursive Enable recursive processing of subdirectories + --max-depth Maximum recursion depth (requires --recursive) + -s, --sequence Select a transformation sequence (default, lower, upper, minimal, utf-8) + -L List all available sequences + -q, --quiet Suppress output (no renaming info on stdout) + -n, --dry-run Only display, but do not make any real changes (dry-run) + -f, --force Overwrite existing files + -e, --exclude Patterns to be ignored (-e "*.py", several can be specified) + -v, --verbose Detailed debug information + --modify-root Allows you to customize the root directory as well + --special Also process symbolic links and special files + --no-color Disable colored output + -h, --help Print help + -V, --version Print version ``` +Colored output can also be disabled via the `NO_COLOR` environment variable (see https://no-color.org/). + ## Test Im Verzeichnis [***./test***](./test) gibt es ein bash-Skript [***create_test_tree.sh***](test/create_test_tree.sh), das lokal 21 Test-Verzeichnisse und 400 Dateien mit skurrilen Zufallsnamen erzeugt. Damit kannst Du ***NameToUnix*** ausprobieren: diff --git a/man/ntu.1 b/man/ntu.1 index 1e6e94e..1a370ce 100644 --- a/man/ntu.1 +++ b/man/ntu.1 @@ -1,4 +1,4 @@ -.TH NTU 1 "2025-02-12" "NameToUnix 1.2.0" "User Commands" +.TH NTU 1 "2026-02-13" "NameToUnix 1.2.1" "User Commands" .SH NAME ntu \- sanitize file and directory names to Unix conventions .SH SYNOPSIS @@ -55,7 +55,8 @@ Allow renaming of the root directory itself (normally skipped) Process symbolic links and special files (normally skipped) .TP .BR \-\-no\-color -Disable colored output +Disable colored output. The \fBNO_COLOR\fR environment variable is also +respected (see \fIhttps://no-color.org/\fR). .TP .BR \-h ", " \-\-help Print help information @@ -180,18 +181,28 @@ Symlinks are still not followed (targets remain unchanged) Safe: only the link itself is renamed, not what it points to .SH CONFIGURATION .B ntu -looks for configuration files in the following locations (in order): +looks for configuration files in the following locations. Later files +override earlier ones (highest priority last): .PP .nf .RS -./.NameToUnix.conf -~/.config/NameToUnix/config.toml -/etc/NameToUnix/config.toml +1. /etc/NameToUnix/config.toml (system-wide, lowest priority) +2. ~/.config/NameToUnix/config.toml (user-specific) +3. ./.NameToUnix.conf (working directory, highest priority) .RE .fi .PP -Configuration files can customize character replacements and other behavior. -See the project documentation for configuration file format. +When using \fB\-\-conf\fR, the standard hierarchy is bypassed and only the +specified file is loaded. +.PP +Configuration files use TOML format with a \fB[replacements]\fR section +for custom character replacements. See the project documentation for details. +.SH ENVIRONMENT +.TP +.B NO_COLOR +When set (to any value), colored output is disabled. This follows the +convention described at \fIhttps://no-color.org/\fR. The \fB\-\-no\-color\fR +flag has the same effect. .SH EXIT STATUS .TP .B 0