From b58a5b3e095cbecba2d97f0b6bc516c755294f0c Mon Sep 17 00:00:00 2001 From: bobokun Date: Mon, 1 Sep 2025 08:24:30 -0400 Subject: [PATCH] feat(cli): add optional value support to --web-server flag Allow --web-server to accept an optional argument for enabling or disabling the web server, improving flexibility in command-line usage. Previously, it was a simple boolean flag; now it supports values like --web-server=False to explicitly disable. --- VERSION | 2 +- qbit_manage.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index b939558..c932928 100755 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.6.1-develop2 +4.6.1-develop3 diff --git a/qbit_manage.py b/qbit_manage.py index 139aa45..ac43c00 100755 --- a/qbit_manage.py +++ b/qbit_manage.py @@ -51,9 +51,12 @@ parser.add_argument( "-ws", "--web-server", dest="web_server", - action="store_true", + nargs="?", + const=True, + type=lambda x: str(x).lower() not in ("false", "0", "no", "off", "f", "n"), default=None, help="Start the webUI server to handle command requests via HTTP API. " + "Pass --web-server to enable, --web-server=False to disable. " "Default: enabled on desktop (non-Docker) runs; disabled in Docker.", ) parser.add_argument(