From 8435e137f2652cd06ff3fccb42f9ed9280b2e56b Mon Sep 17 00:00:00 2001 From: VKrishna04 <75069043+VKrishna04@users.noreply.github.com> Date: Sun, 24 Nov 2024 16:22:52 +0000 Subject: [PATCH] 24 November 2024 21:53:08 - Add CLI mode support and refactor app entry point --- app.py | 16 ++++++++++++---- run_app.bat | 1 - 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app.py b/app.py index 3d43a1a..b5c7aad 100644 --- a/app.py +++ b/app.py @@ -18,8 +18,16 @@ from cli_app import run_cli_app if __name__ == "__main__": - streamlit_server = os.getenv("STREAMLIT_SERVER") - if streamlit_server and "streamlit" in streamlit_server: - run_streamlit_app() - else: + parser = argparse.ArgumentParser( + description="Run the application in different modes" + ) + parser.add_argument( + "--cli", action="store_true", help="Run the application in CLI mode" + ) + + args = parser.parse_args() + + if args.cli: run_cli_app() + else: + run_streamlit_app() diff --git a/run_app.bat b/run_app.bat index 05ecfbb..d15c979 100644 --- a/run_app.bat +++ b/run_app.bat @@ -1,5 +1,4 @@ @echo off -set STREAMLIT_SERVER=streamlit cd /d "%~dp0" echo Checking for required dependencies...