Respect direct input path arguments

This commit is contained in:
Melbar
2026-05-07 18:15:27 +02:00
parent 9c4fd4d6ef
commit 5d71c81f22
2 changed files with 12 additions and 3 deletions
+6
View File
@@ -58,6 +58,12 @@ Fuer automatisierte CLI-Laeufe kann das Encoding direkt gestartet werden:
py -3 .\pvd_mezzanine.py --cli "C:\Pfad\zur\Quelle.mov" py -3 .\pvd_mezzanine.py --cli "C:\Pfad\zur\Quelle.mov"
``` ```
Alternativ kann die Datei direkt als erster Parameter uebergeben werden:
```powershell
.\create_mezzanine.bat "C:\Pfad\zur\Quelle.mov"
```
## Ausgabe ## Ausgabe
Das Script schreibt die fertige Mezzanine-Datei standardmäßig nach: Das Script schreibt die fertige Mezzanine-Datei standardmäßig nach:
+6 -3
View File
@@ -525,9 +525,6 @@ def run_cli(input_file: str, output_dir: str = OUTPUT_BASE_DIR) -> int:
except Exception as exc: except Exception as exc:
print(f"\nFEHLER: {exc}") print(f"\nFEHLER: {exc}")
return 1 return 1
finally:
if sys.stdin.isatty():
os.system("pause")
class MezzanineApp: class MezzanineApp:
@@ -762,6 +759,12 @@ Write-Output $open.FileName
def main() -> int: def main() -> int:
if len(sys.argv) > 2 and sys.argv[1] == "--cli": if len(sys.argv) > 2 and sys.argv[1] == "--cli":
return run_cli(sys.argv[2], OUTPUT_BASE_DIR) return run_cli(sys.argv[2], OUTPUT_BASE_DIR)
if len(sys.argv) > 1:
input_file = sys.argv[1]
if not os.path.isfile(input_file):
print(f"FEHLER: Eingabedatei nicht gefunden: {input_file}")
return 1
return run_cli(input_file, OUTPUT_BASE_DIR)
return run_ui() return run_ui()