-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.py
More file actions
73 lines (58 loc) · 1.97 KB
/
cli.py
File metadata and controls
73 lines (58 loc) · 1.97 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
from generator import generator
from pdf import pdf
from calculator import calculator
CONTACT_EMAIL = "ee1912136@gmail.com"
GITHUB_URL = "https://github.com/EJ-Edwards/InvoiceHub"
def show_terms():
print("\n===== TERMS OF SERVICE =====\n")
print(
"InvoiceHub is provided \"as is\" with no warranty of any kind.\n"
"You are responsible for verifying all invoice data before use.\n"
"The creators are not liable for financial loss, incorrect billing,\n"
"or tax-related issues.\n\n"
"InvoiceHub does not provide legal, tax, or accounting advice.\n"
"By continuing to use this software, you agree to these terms.\n"
)
print("Need help or have questions?")
print(f"Contact: {CONTACT_EMAIL}")
print(f"GitHub: {GITHUB_URL}")
print("\n============================\n")
def accept_terms():
show_terms()
while True:
choice = input("Do you accept the Terms of Service? (y/n): ").lower()
if choice == "y":
return True
elif choice == "n":
print("\nYou must accept the terms to use InvoiceHub.")
return False
else:
print("Please enter 'y' or 'n'.")
def menu():
if not accept_terms():
return
while True:
print("\nInvoiceHub CLI")
print("1. Generate Invoice")
print("2. View PDF")
print("3. Calculate Total")
print("4. Contact / Help")
print("5. Exit")
choice = input("Select an option: ")
if choice == "1":
generator()
elif choice == "2":
pdf()
elif choice == "3":
calculator()
elif choice == "4":
print("\n===== CONTACT =====")
print(f"Email: {CONTACT_EMAIL}")
print(f"GitHub: {GITHUB_URL}")
elif choice == "5":
print("Goodbye 👋")
break
else:
print("Invalid option. Try again.")
if __name__ == "__main__":
menu()