-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackupforge.py
More file actions
48 lines (41 loc) · 1.42 KB
/
backupforge.py
File metadata and controls
48 lines (41 loc) · 1.42 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python3
"""
BackupForge - A command-line database backup utility
"""
import sys
from cli.parser import create_parser
try:
from importlib.metadata import version as get_version
except ImportError:
# For Python < 3.8
from importlib_metadata import version as get_version
def print_banner():
"""Print the BackupForge banner with version and tagline"""
try:
version = get_version('backupforge-cli')
except Exception:
version = "1.0.0" # Default version
banner = f"""
╔═══════════════════════════════════════╗
║ ║
║ 🔨 BackupForge v{version} ║
║ Professional Database Backup Tool ║
║ ║
╚═══════════════════════════════════════╝
Forging Reliable Database Backups
"""
print(banner)
def main():
"""Main entry point for the BackupForge CLI utility"""
# Print banner before executing commands
print_banner()
parser = create_parser()
args = parser.parse_args()
# Execute the appropriate command based on subcommand
if hasattr(args, 'func'):
return args.func(args)
else:
parser.print_help()
return 0
if __name__ == '__main__':
sys.exit(main())