From 3a867e3b0c966f84d607fc0ceafb2fdee893ed5d Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Wed, 18 Mar 2026 16:14:58 +0100 Subject: Reorganize main menu with grouped sections and quit on 0 --- egometrics.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/egometrics.py b/egometrics.py index 5a8a556..87bd0b8 100644 --- a/egometrics.py +++ b/egometrics.py @@ -17,14 +17,21 @@ def main_menu(conn: sqlite3.Connection) -> None: while True: ui.clear_screen() print("=== EgoMetrics ===\n") - print("1. Log Workout") - print("2. View Workout Sessions") - print("3. Manage Workout Exercises") - print("4. Manage Workout Templates") + print("0. Quit\n") + + print("=== Workout ===\n") + print("1. Log Session") + print("2. View Sessions Logs") + print("3. Manage Exercises") + print("4. Manage Session Templates\n") + + print("=== Weight ===\n") print("5. Log Weight") print("6. View Weight Logs") - print("7. Quit") + choice = input("\n> ").strip() + if choice == "0": + break if choice == "1": log_workout(conn) elif choice == "2": @@ -37,8 +44,6 @@ def main_menu(conn: sqlite3.Connection) -> None: log_weight(conn) elif choice == "6": view_weight_logs(conn) - elif choice == "7": - break def main() -> None: -- cgit v1.2.3