From a9d4f8e3d711a5c23b90f7cb73ffae43e3d48a0d Mon Sep 17 00:00:00 2001 From: HappyZ Date: Wed, 10 May 2023 15:40:07 -0700 Subject: [PATCH] [Manage] adds debug flag to enable database for debugging only --- manage_db.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/manage_db.py b/manage_db.py index cce53d4..cf71240 100644 --- a/manage_db.py +++ b/manage_db.py @@ -184,6 +184,9 @@ def manage(args): # Path to the lock file lock_file = "/tmp/happysd_db.lock" + if args.debug: + db_path = "happysd_debug.db" + # Connect to the database (creates a new file if it doesn't exist) conn = sqlite3.connect(db_path) @@ -244,6 +247,9 @@ def manage(args): def main(): # Parse command-line arguments parser = argparse.ArgumentParser() + parser.add_argument( + "--debug", action="store_true", help="Enable debugging mode" + ) subparsers = parser.add_subparsers(dest="action", required=True) # Sub-parser for the "create" action