refactor: Binary von NameToUnix zu ntu umbenannt
- Binary heißt jetzt 'ntu' für kürzere CLI-Nutzung - Package-Name bleibt 'NameToUnix' (für Repository/Crate) - Alle Beispiele und Dokumentation in README.md angepasst - CLAUDE.md mit neuen Build-Pfaden aktualisiert - Cargo.toml: [[bin]] Sektion und deb assets angepasst Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
df4421af2f
commit
0860fae6ec
3 changed files with 40 additions and 30 deletions
|
|
@ -18,7 +18,7 @@ cargo build
|
|||
cargo build --release
|
||||
|
||||
# Binary liegt dann unter:
|
||||
# target/release/NameToUnix
|
||||
# target/release/ntu
|
||||
|
||||
# Tests ausführen
|
||||
cargo test
|
||||
|
|
@ -45,12 +45,18 @@ cd test
|
|||
|
||||
# Vorschau (keine Änderungen):
|
||||
cargo run -- -n ./testverzeichnis
|
||||
# oder mit installierter Binary:
|
||||
ntu -n ./testverzeichnis
|
||||
|
||||
# Mit Änderungen:
|
||||
cargo run -- ./testverzeichnis
|
||||
# oder:
|
||||
ntu ./testverzeichnis
|
||||
|
||||
# Mit Verbose-Ausgabe:
|
||||
cargo run -- -v ./testverzeichnis
|
||||
# oder:
|
||||
ntu -v ./testverzeichnis
|
||||
```
|
||||
|
||||
## Code-Architektur
|
||||
|
|
|
|||
|
|
@ -10,6 +10,10 @@ repository = "https://github.com/jamulix/NameToUnix"
|
|||
keywords = ["filesystem", "rename", "sanitize", "cli"]
|
||||
categories = ["command-line-utilities", "filesystem"]
|
||||
|
||||
[[bin]]
|
||||
name = "ntu"
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
# Bereits verwendete Abhängigkeiten
|
||||
clap = { version = "4.5.27", features = ["derive"] }
|
||||
|
|
@ -57,7 +61,7 @@ depends = "$auto"
|
|||
section = "utils"
|
||||
priority = "optional"
|
||||
assets = [
|
||||
["target/release/NameToUnix", "usr/bin/", "755"],
|
||||
["target/release/ntu", "usr/bin/", "755"],
|
||||
["README.md", "usr/share/doc/NameToUnix/README", "644"],
|
||||
]
|
||||
|
||||
|
|
|
|||
56
README.md
56
README.md
|
|
@ -41,22 +41,22 @@ Dies ist mein erstes Programm in Rust. (Bitte seid gnädig.)
|
|||
|
||||
## Installation
|
||||
|
||||
Die ausführbare Datei wird unter `target/release/NameToUnix` erstellt. Du solltest sie mit 'sudo cp target/release/NameToUnix /usr/local/bin/' kopieren. Sie ist dann für alle User verfügbar. Denke daran, die Konfiguationsdatei (s. u.) ebenfalls zu kopieren. Sie kann für jeden User individuell angepasst werden, wenn sie im home-Verzeichnis des Users liegt.
|
||||
Die ausführbare Datei wird unter `target/release/ntu` erstellt. Du solltest sie mit 'sudo cp target/release/ntu /usr/local/bin/' kopieren. Sie ist dann für alle User verfügbar. Denke daran, die Konfiguationsdatei (s. u.) ebenfalls zu kopieren. Sie kann für jeden User individuell angepasst werden, wenn sie im home-Verzeichnis des Users liegt.
|
||||
|
||||
The executable file is created under `target/release/NameToUnix`. You should copy it with 'sudo cp target/release/NameToUnix /usr/local/bin/'. It is then available for all users. Remember to copy the configuration file (see below) as well. It can be customized for each user individually if it is located in the user's home directory.
|
||||
The executable file is created under `target/release/ntu`. You should copy it with 'sudo cp target/release/ntu /usr/local/bin/'. It is then available for all users. Remember to copy the configuration file (see below) as well. It can be customized for each user individually if it is located in the user's home directory.
|
||||
|
||||
```bash
|
||||
git clone https://github.com/jamulix/NameToUnix.git # Download repository
|
||||
cd NameToUnix # Change to download directory
|
||||
cargo build --release # Build binary
|
||||
sudo cp target/release/NameToUnix /usr/local/bin/ # copy binary to local bin directory
|
||||
sudo cp target/release/ntu /usr/local/bin/ # copy binary to local bin directory
|
||||
|
||||
# Globale Einstellungen / Global Settings
|
||||
sudo mkdir -p /etc/NameToUnix/ # Create global config directory for NameToUnix in /etc
|
||||
sudo cp .NameToUnix.conf /etc/NameToUnix/config.toml # Copy config file to this global directory
|
||||
|
||||
# Lokale Einstellungen / Local settings
|
||||
mkdir -p ~/.config/NameToUnix/ # Create a personal config directory for NameToUnix
|
||||
mkdir -p ~/.config/NameToUnix/ # Create a personal config directory for NameToUnix
|
||||
cp .NameToUnix.conf ~/.config/NameToUnix/config.toml # Copy config file to this personal directory
|
||||
```
|
||||
|
||||
|
|
@ -64,44 +64,44 @@ cp .NameToUnix.conf ~/.config/NameToUnix/config.toml # Copy config file to
|
|||
|
||||
```bash
|
||||
# Basic usage
|
||||
NameToUnix /path/to/files
|
||||
ntu /path/to/files
|
||||
|
||||
# Only preview the changes without actual renaming
|
||||
NameToUnix -n /path/to/files
|
||||
ntu -n /path/to/files
|
||||
|
||||
# Process multiple paths
|
||||
NameToUnix /path1 /path2 /path3
|
||||
ntu /path1 /path2 /path3
|
||||
|
||||
# Exclude specific files
|
||||
NameToUnix -e “*.tmp” -e “backup_*” /path/to/files
|
||||
ntu -e "*.tmp" -e "backup_*" /path/to/files
|
||||
|
||||
# Increase verbosity
|
||||
NameToUnix -v /path/to/files
|
||||
ntu -v /path/to/files
|
||||
|
||||
# Also rename the root directory
|
||||
NameToUnix --modify-root /path/to/files
|
||||
ntu --modify-root /path/to/files
|
||||
|
||||
```
|
||||
## Verwendung
|
||||
|
||||
```bash
|
||||
# Grundlegende Verwendung
|
||||
NameToUnix /pfad/zu/dateien
|
||||
ntu /pfad/zu/dateien
|
||||
|
||||
# Nur Vorschau der Änderungen ohne tatsächliche Umbenennung
|
||||
NameToUnix -n /pfad/zu/dateien
|
||||
ntu -n /pfad/zu/dateien
|
||||
|
||||
# Mehrere Pfade verarbeiten
|
||||
NameToUnix /pfad1 /pfad2 /pfad3
|
||||
ntu /pfad1 /pfad2 /pfad3
|
||||
|
||||
# Bestimmte Dateien ausschließen
|
||||
NameToUnix -e "*.tmp" -e "backup_*" /pfad/zu/dateien
|
||||
ntu -e "*.tmp" -e "backup_*" /pfad/zu/dateien
|
||||
|
||||
# Verbosity erhöhen
|
||||
NameToUnix -v /pfad/zu/dateien
|
||||
ntu -v /pfad/zu/dateien
|
||||
|
||||
# Auch das Wurzelverzeichnis umbenennen
|
||||
NameToUnix --modify-root /pfad/zu/dateien
|
||||
ntu --modify-root /pfad/zu/dateien
|
||||
```
|
||||
|
||||
## Configuration File / Konfiguration
|
||||
|
|
@ -146,7 +146,7 @@ You should also create a central configuration file /etc/NameToUnix/config.toml
|
|||
# Dadurch werden in den Dateinamen alle "foo" durch "bar" ersetzt, und "old" durch "neu".
|
||||
# WICHTIG: Die hartcodierten Transformationen sind aber immer vorrangig und lassen sich auch nicht rückgängig machen.
|
||||
# Die persönlichen Einstellungen überschreiben diese Einstellungen.
|
||||
# VORSICHT! Zuerst mit 'NameToUnix -n <path>' testen
|
||||
# VORSICHT! Zuerst mit 'ntu -n <path>' testen
|
||||
# --------------------------------------------
|
||||
# In this file, any additional key-value pairs can be stored under [replacements],
|
||||
# which are replaced in the file master name. For example:
|
||||
|
|
@ -159,7 +159,7 @@ You should also create a central configuration file /etc/NameToUnix/config.toml
|
|||
# IMPORTANT: The hard-coded transformations always have priority and cannot be undone.
|
||||
# The personal settings overwrite these settings.
|
||||
|
||||
# BE CAREFUL! First test with 'NameToUnix -n <path>' (Just display the changes)
|
||||
# BE CAREFUL! First test with 'ntu -n <path>' (Just display the changes)
|
||||
|
||||
[replacements]
|
||||
".." = "."
|
||||
|
|
@ -171,10 +171,10 @@ You should also create a central configuration file /etc/NameToUnix/config.toml
|
|||
|
||||
### Verwendung von NameToUnix
|
||||
|
||||
Um die Verwendung von `NameToUnix` zu verstehen, kannst du die folgende Hilfe ausgeben:
|
||||
Um die Verwendung von `ntu` zu verstehen, kannst du die folgende Hilfe ausgeben:
|
||||
|
||||
```text
|
||||
NameToUnix --help
|
||||
ntu --help
|
||||
```
|
||||
|
||||
Die Ausgabe sieht wie folgt aus:
|
||||
|
|
@ -182,7 +182,7 @@ Die Ausgabe sieht wie folgt aus:
|
|||
```text
|
||||
Ein Tool zum Anpassen von Verzeichnis- und Dateinamen an Linux-Konventionen
|
||||
|
||||
Usage: NameToUnix [OPTIONS] [PATHS]...
|
||||
Usage: ntu [OPTIONS] [PATHS]...
|
||||
|
||||
Arguments:
|
||||
[PATHS]... Pfade (Dateien und Verzeichnisse) zum rekursiven Anpassen
|
||||
|
|
@ -204,7 +204,7 @@ Options:
|
|||
```text
|
||||
A tool for adapting directories and file names to Linux conventions
|
||||
|
||||
Usage: NameToUnix [OPTIONS] [PATHS]...
|
||||
Usage: ntu [OPTIONS] [PATHS]...
|
||||
|
||||
Arguments:
|
||||
[PATHS]... Paths (files and directories) for recursive customization
|
||||
|
|
@ -224,17 +224,17 @@ Options:
|
|||
## 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:
|
||||
|
||||
***NameToUnix -n ./testverzeichnis*** (nur Anzeige der Änderungen)
|
||||
|
||||
***ntu -n ./testverzeichnis*** (nur Anzeige der Änderungen)
|
||||
oder
|
||||
***NameToUnix ./testverzeichnis*** (Anzeige mit Umbenennen).
|
||||
***ntu ./testverzeichnis*** (Anzeige mit Umbenennen).
|
||||
|
||||
|
||||
In the directory [***./test***](./test) there is a bash script [***create_test_tree.sh***](test/create_test_tree.sh), which locally creates 21 test directories and 400 files with bizarre random names. You can use this to try out ***NameToUnix***:
|
||||
|
||||
***NameToUnix -n ./testverzeichnis*** (display changes only)
|
||||
|
||||
***ntu -n ./testverzeichnis*** (display changes only)
|
||||
or
|
||||
***NameToUnix ./testverzeichnis*** (display with renaming).
|
||||
***ntu ./testverzeichnis*** (display with renaming).
|
||||
|
||||
## Lizenz / License
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue