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.
This commit is contained in:
bobokun 2025-09-01 08:24:30 -04:00
parent e0905b214f
commit b58a5b3e09
No known key found for this signature in database
GPG key ID: B73932169607D927
2 changed files with 5 additions and 2 deletions

View file

@ -1 +1 @@
4.6.1-develop2 4.6.1-develop3

View file

@ -51,9 +51,12 @@ parser.add_argument(
"-ws", "-ws",
"--web-server", "--web-server",
dest="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, default=None,
help="Start the webUI server to handle command requests via HTTP API. " 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.", "Default: enabled on desktop (non-Docker) runs; disabled in Docker.",
) )
parser.add_argument( parser.add_argument(