20 lines
509 B
Python
20 lines
509 B
Python
"""Allow running transmutate_app as a module: python -m transmutate_app <file>."""
|
|
|
|
import sys
|
|
import os
|
|
from .gui import open_file
|
|
|
|
|
|
def main():
|
|
"""CLI entry point for ``python -m transmutate_app <file>``."""
|
|
if len(sys.argv) < 2:
|
|
print("Usage: python -m transmutate_app <path/to/file>")
|
|
sys.exit(1)
|
|
|
|
filepath = sys.argv[1]
|
|
if not os.path.isfile(filepath):
|
|
print(f"Error: File does not exist: {filepath}", file=sys.stderr)
|
|
sys.exit(1)
|
|
|
|
open_file(filepath)
|