-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.py
More file actions
28 lines (23 loc) · 682 Bytes
/
Copy pathcli.py
File metadata and controls
28 lines (23 loc) · 682 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
# cli.py
import argparse
from datetime import date
from countdown_basic import days_until_new_year
import countdown_snow
def main() -> None:
parser = argparse.ArgumentParser(
description="New Year countdown with optional ASCII snow animation."
)
parser.add_argument(
"--mode",
choices=["basic", "snow"],
default="basic",
help="Display mode: basic text or snow animation.",
)
args = parser.parse_args()
if args.mode == "basic":
days = days_until_new_year()
print(f"Days left until New Year: {days}")
elif args.mode == "snow":
countdown_snow.main()
if __name__ == "__main__":
main()