-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
31 lines (28 loc) · 1.32 KB
/
Copy pathmain.py
File metadata and controls
31 lines (28 loc) · 1.32 KB
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
#!/usr/bin/env python3
"""
Citation Generator - Main entry point for the application.
This script launches the appropriate interface based on command-line arguments.
"""
import sys
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Citation Generator - Advanced bibliography management tool")
parser.add_argument('--cli', action='store_true', help='Run in command line mode')
parser.add_argument('--api', action='store_true', help='Run as API server')
parser.add_argument('--port', type=int, default=5000, help='Port for API server (default: 5000)')
parser.add_argument('--host', default='0.0.0.0', help='Host for API server (default: 0.0.0.0)')
parser.add_argument('--debug', action='store_true', help='Run in debug mode')
args = parser.parse_args()
# Default to GUI if no interface specified
if not (args.cli or args.api):
print("Launching GUI application...")
from citationapp.gui.app import run_app
run_app()
elif args.cli:
print("Running in command line mode...")
from citationapp.main import main
main()
elif args.api:
print(f"Starting API server on {args.host}:{args.port}...")
from citationapp.api.rest import run_api
run_api(host=args.host, port=args.port, debug=args.debug)