-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
33 lines (27 loc) · 815 Bytes
/
Copy pathmain.py
File metadata and controls
33 lines (27 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""
GitQuickTool — Main entry point.
Auto-detects GUI/CLI mode based on arguments and environment.
"""
import sys
import os
def main():
# CLI mode if arguments provided
if len(sys.argv) > 1:
from cli.commands import run_cli
run_cli()
return
# GUI mode
try:
from ui.app import run_gui
run_gui()
except ImportError as e:
print(f"GUI not available ({e}). Use CLI mode: python main.py --help")
sys.exit(1)
except Exception as e:
# Fallback: if no display available (headless Linux), suggest CLI
if "display" in str(e).lower() or "no display" in str(e).lower():
print("No display detected. Use CLI mode: python main.py --help")
sys.exit(1)
raise
if __name__ == "__main__":
main()