v1.0.1
-Merge branch 'bugfix/ignore'
This commit is contained in:
commit
f80f6ac707
14
.gitignore
vendored
14
.gitignore
vendored
@ -19,3 +19,17 @@ desktop.ini
|
|||||||
# Releases (realAscot)
|
# Releases (realAscot)
|
||||||
releases/**
|
releases/**
|
||||||
bin/**
|
bin/**
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
*zip
|
||||||
|
*.tar.gz
|
||||||
|
*.tar.xz
|
||||||
|
*.tar.bz2
|
||||||
|
*.tar.lz
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
# Changelog treeScanner (Rust)
|
# Changelog treeScanner (Rust)
|
||||||
|
|
||||||
|
- **2025-05-24 - v1.0.1**
|
||||||
|
- **Bugfix:**
|
||||||
|
- [x] Parameter werden nun richtig geparst, auch `-x ./fu/,./bla` statt bisher nur `-x fu,bla`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
- **2025-05-17 - v1.0.0**
|
- **2025-05-17 - v1.0.0**
|
||||||
- **Geändert:**
|
- **Geändert:**
|
||||||
- [x] Komplette Neuumsetzung des TreeScanner-Tools in Rust
|
- [x] Komplette Neuumsetzung des TreeScanner-Tools in Rust
|
||||||
|
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -458,7 +458,7 @@ checksum = "bfb942dfe1d8e29a7ee7fcbde5bd2b9a25fb89aa70caea2eba3bee836ff41076"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "treescanner"
|
name = "treescanner"
|
||||||
version = "1.0.0"
|
version = "1.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"dirs",
|
"dirs",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "treescanner"
|
name = "treescanner"
|
||||||
version = "1.0.0"
|
version = "1.0.1"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[package.metadata.winres]
|
[package.metadata.winres]
|
||||||
|
@ -28,8 +28,9 @@ Der original treeScanner in Python ist unter <https://github.com/realAscot/treeS
|
|||||||
- [🔍 Ort](#-ort)
|
- [🔍 Ort](#-ort)
|
||||||
- [📘 Format](#-format)
|
- [📘 Format](#-format)
|
||||||
- [📝 Format (.toml)](#-format-toml)
|
- [📝 Format (.toml)](#-format-toml)
|
||||||
|
- [Build](#build)
|
||||||
- [Lizenz](#lizenz)
|
- [Lizenz](#lizenz)
|
||||||
- [Eingesetzte Libraries (MIT-kompatibel):](#eingesetzte-libraries-mit-kompatibel)
|
- [Eingesetzte Libraries (MIT-kompatibel)](#eingesetzte-libraries-mit-kompatibel)
|
||||||
- [💬 Kontakt](#-kontakt)
|
- [💬 Kontakt](#-kontakt)
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -180,11 +181,15 @@ align_comments = false
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## Build
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Lizenz
|
## Lizenz
|
||||||
|
|
||||||
Dieses Projekt steht unter der [MIT-Lizenz](./LICENSE).
|
Dieses Projekt steht unter der [MIT-Lizenz](./LICENSE).
|
||||||
|
|
||||||
### Eingesetzte Libraries (MIT-kompatibel):
|
### Eingesetzte Libraries (MIT-kompatibel)
|
||||||
|
|
||||||
| Crate | Lizenz |
|
| Crate | Lizenz |
|
||||||
|-----------------|------------|
|
|-----------------|------------|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#include <winver.h>
|
#include <winver.h>
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 1,0,0,0
|
FILEVERSION 1,0,1,0
|
||||||
PRODUCTVERSION 1,0,0,0
|
PRODUCTVERSION 1,0,0,0
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
FILEFLAGS 0x0L
|
FILEFLAGS 0x0L
|
||||||
@ -17,11 +17,11 @@ BEGIN
|
|||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "ionivation.com"
|
VALUE "CompanyName", "ionivation.com"
|
||||||
VALUE "FileDescription", "CLI Verzeichnisscanner"
|
VALUE "FileDescription", "CLI Verzeichnisscanner"
|
||||||
VALUE "FileVersion", "1.0.0.0"
|
VALUE "FileVersion", "1.0.1.0"
|
||||||
VALUE "InternalName", "treescanner"
|
VALUE "InternalName", "treescanner"
|
||||||
VALUE "OriginalFilename", "treescanner.exe"
|
VALUE "OriginalFilename", "treescanner.exe"
|
||||||
VALUE "ProductName", "CLI Treescanner"
|
VALUE "ProductName", "CLI Treescanner"
|
||||||
VALUE "ProductVersion", "1.0.0"
|
VALUE "ProductVersion", "1.0.1"
|
||||||
VALUE "LegalCopyright", "(C) 2025 Adam Skotarczak"
|
VALUE "LegalCopyright", "(C) 2025 Adam Skotarczak"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
@ -54,17 +54,26 @@ impl TreeBuilder {
|
|||||||
let mut folders = vec![];
|
let mut folders = vec![];
|
||||||
let mut files = vec![];
|
let mut files = vec![];
|
||||||
|
|
||||||
|
|
||||||
for entry in entries {
|
for entry in entries {
|
||||||
|
let path = entry.path();
|
||||||
let file_name = entry.file_name().into_string().unwrap_or_default();
|
let file_name = entry.file_name().into_string().unwrap_or_default();
|
||||||
if entry.path().is_dir() {
|
|
||||||
if !self.config.ignored_dirs.contains(&file_name) {
|
if path.is_dir() {
|
||||||
folders.push((file_name, entry.path()));
|
|
||||||
|
if let Some(dir_name) = path.file_name().and_then(|s| s.to_str()) {
|
||||||
|
if self.config.ignored_dirs.iter().any(|ex| ex == dir_name) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
folders.push((file_name, path));
|
||||||
} else {
|
} else {
|
||||||
files.push(file_name);
|
files.push(file_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for (idx, (name, path)) in folders.iter().enumerate() {
|
for (idx, (name, path)) in folders.iter().enumerate() {
|
||||||
self.folder_count += 1;
|
self.folder_count += 1;
|
||||||
let connector = if idx < folders.len() - 1 || !files.is_empty() { "├── " } else { "└── " };
|
let connector = if idx < folders.len() - 1 || !files.is_empty() { "├── " } else { "└── " };
|
||||||
|
@ -42,7 +42,7 @@ pub struct CliArgs {
|
|||||||
pub output: Option<PathBuf>,
|
pub output: Option<PathBuf>,
|
||||||
|
|
||||||
/// Nur in Konsole anzeigen, keine Ausgabedatei speichern
|
/// Nur in Konsole anzeigen, keine Ausgabedatei speichern
|
||||||
#[arg(long)]
|
#[arg(short = 'i', long)]
|
||||||
pub viewonly: bool,
|
pub viewonly: bool,
|
||||||
|
|
||||||
/// Debug-Modus aktivieren
|
/// Debug-Modus aktivieren
|
||||||
|
22
src/main.rs
22
src/main.rs
@ -16,6 +16,15 @@ fn view_timer(timer: &Instant) {
|
|||||||
println!("\n⏱️ Gesamtlaufzeit des Scans: {:.2?}", timer.elapsed());
|
println!("\n⏱️ Gesamtlaufzeit des Scans: {:.2?}", timer.elapsed());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hilfsfunktion zur Pfad-Normalisierung
|
||||||
|
fn normalize_ignore_entry(s: &str) -> String {
|
||||||
|
s.trim_start_matches("./")
|
||||||
|
.trim_start_matches(".\\")
|
||||||
|
.trim_end_matches('/')
|
||||||
|
.trim_end_matches('\\')
|
||||||
|
.to_string()
|
||||||
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
init_logger();
|
init_logger();
|
||||||
let args = CliArgs::parse();
|
let args = CliArgs::parse();
|
||||||
@ -34,6 +43,12 @@ fn main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let ignored_dirs: Vec<String> = match (!args.ignore.is_empty(), file_config.ignore) {
|
||||||
|
(true, _) => args.ignore.iter().map(|s| normalize_ignore_entry(s)).collect(),
|
||||||
|
(false, Some(set)) => set.into_iter().map(|s| normalize_ignore_entry(&s)).collect(),
|
||||||
|
(false, None) => vec![],
|
||||||
|
};
|
||||||
|
|
||||||
let config = TreeBuilderConfig {
|
let config = TreeBuilderConfig {
|
||||||
root_path: args.root_path.clone(),
|
root_path: args.root_path.clone(),
|
||||||
max_depth: args.max_depth.or(file_config.max_depth),
|
max_depth: args.max_depth.or(file_config.max_depth),
|
||||||
@ -42,12 +57,7 @@ fn main() {
|
|||||||
} else {
|
} else {
|
||||||
file_config.max_files_per_dir.unwrap_or(100)
|
file_config.max_files_per_dir.unwrap_or(100)
|
||||||
},
|
},
|
||||||
// Ignorierte Verzeichnisse: CLI hat Vorrang, dann Config, sonst leer
|
ignored_dirs,
|
||||||
ignored_dirs: match (!args.ignore.is_empty(), file_config.ignore) {
|
|
||||||
(true, _) => args.ignore,
|
|
||||||
(false, Some(set)) => set.into_iter().collect(),
|
|
||||||
(false, None) => vec![],
|
|
||||||
},
|
|
||||||
folder_icon: "📁".to_string(),
|
folder_icon: "📁".to_string(),
|
||||||
file_icon: "📄".to_string(),
|
file_icon: "📄".to_string(),
|
||||||
align_comments: args.align_comments,
|
align_comments: args.align_comments,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user