v0.3.1
This commit is contained in:
parent
6c8dc35cc0
commit
d14bf3e58a
@ -1,5 +1,11 @@
|
|||||||
# CHANGELOG - treeScannerASCII
|
# CHANGELOG - treeScannerASCII
|
||||||
|
|
||||||
|
- **2025-05-01 Commit v0.3.1**
|
||||||
|
|
||||||
|
- **Geändert:**
|
||||||
|
- [x] `scanner.py` um Lizenz und Anleitung ergänzt. Wurde beim letzten Commit vergessen.
|
||||||
|
ausserdem hat sich in die Datei Unicode eingeschlichen der dort nicht hingehörte.
|
||||||
|
|
||||||
- **2025-04-30 Commit v0.3.0**
|
- **2025-04-30 Commit v0.3.0**
|
||||||
|
|
||||||
- **Geändert:**
|
- **Geändert:**
|
||||||
@ -10,7 +16,7 @@
|
|||||||
- **Hinzugefügt:**
|
- **Hinzugefügt:**
|
||||||
- [x] Unterstützung für Paket-Ausführung via `python -m treeScannerASCII`
|
- [x] Unterstützung für Paket-Ausführung via `python -m treeScannerASCII`
|
||||||
- Leeres `__init__.py` beibehalten
|
- Leeres `__init__.py` beibehalten
|
||||||
- `__main__.py` mit Fallback-Import (`relative` + `direct`) implementiert
|
- `__main__.py` mit Fallback-Import (`relative` + `direct`) implementiert
|
||||||
|
|
||||||
- **2025-04-27 - Commit v0.2.1**
|
- **2025-04-27 - Commit v0.2.1**
|
||||||
|
|
||||||
|
35
scanner.py
35
scanner.py
@ -1,4 +1,37 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
"""
|
||||||
|
© 2025 Adam Skotarczak (adam@skotarczak.net) v0.3.1 (01.05.2025)
|
||||||
|
A standalone directory scanner that can also be integrated as a module.
|
||||||
|
In its current version, simply place the file into any directory and execute it with python scanner.py.
|
||||||
|
The script generates a tree.txt file containing the complete directory structure in ASCII format.
|
||||||
|
I developed this tool to conveniently document directory trees, particularly for use in Markdown READMEs.
|
||||||
|
|
||||||
|
usage: scanner.py [-h] [-n MAX_FILES_PER_DIR] [-d MAX_DEPTH] [--no-align-comments] [-l {de,en}] [--ignore IGNORE]
|
||||||
|
[-o OUTPUT]
|
||||||
|
[root_path]
|
||||||
|
|
||||||
|
Generiert eine ASCII-Baumstruktur eines Verzeichnisses.
|
||||||
|
|
||||||
|
positional arguments:
|
||||||
|
root_path Pfad des Stammverzeichnisses (default: aktuelles Verzeichnis).
|
||||||
|
|
||||||
|
options:
|
||||||
|
-h, --help show this help message and exit
|
||||||
|
-n, --max-files-per-dir MAX_FILES_PER_DIR
|
||||||
|
Maximale Anzahl Dateien pro Verzeichnis (default: 2).
|
||||||
|
-d, --max-depth MAX_DEPTH
|
||||||
|
Maximale Rekursionstiefe; unbegrenzt, wenn nicht gesetzt.
|
||||||
|
--no-align-comments Deaktiviert das Ausrichten der Kommentare am Zeilenende.
|
||||||
|
-l, --language {de,en}
|
||||||
|
Sprache der Programmausgabe (de oder en).
|
||||||
|
--ignore, -x IGNORE Verzeichnisse, die ignoriert werden sollen (z.B. .git, __pycache__). Mehrfach verwendbar.
|
||||||
|
-o, --output OUTPUT Pfad und Name der Ausgabedatei (Standard: tree.txt)
|
||||||
|
|
||||||
|
|
||||||
|
Original File: <https://github.com/realAscot/treeScannerASCII/blob/main/scanner.py>
|
||||||
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import argparse
|
import argparse
|
||||||
import time
|
import time
|
||||||
@ -160,7 +193,7 @@ def main():
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--ignore", "-x",
|
"--ignore", "-x",
|
||||||
action="append",
|
action="append",
|
||||||
help="Verzeichnisse, die ignoriert werden sollen (z. B. .git, __pycache__). Mehrfach verwendbar."
|
help="Verzeichnisse, die ignoriert werden sollen (z.B. .git, __pycache__). Mehrfach verwendbar."
|
||||||
)
|
)
|
||||||
|
|
||||||
parser.add_argument("-o", "--output", type=str, help="Pfad und Name der Ausgabedatei (Standard: tree.txt)")
|
parser.add_argument("-o", "--output", type=str, help="Pfad und Name der Ausgabedatei (Standard: tree.txt)")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user