Private
Public Access
feat(paths): remove SLOP_CONFIG env-var fallback; add --config CLI flag (FR2)
This commit is contained in:
@@ -33,6 +33,7 @@ parser.add_argument("--headless", action="store_true", help="Run in headless mod
|
||||
parser.add_argument("--web-host", default=None, help="Enable web mode and bind to this host (e.g., 0.0.0.0)")
|
||||
parser.add_argument("--web-port", type=int, default=8080, help="Web mode port (default: 8080)")
|
||||
parser.add_argument("--enable-test-hooks", action="store_true", help="Enable the HookServer on :8999 for external automation")
|
||||
parser.add_argument("--config", default=None, help="Override config.toml path (replaces historical SLOP_CONFIG env var; default: <project_root>/config.toml)")
|
||||
# Defer parse_args() so `import sloppy` (for _SLOPPY_COLD_START_TS) doesn't
|
||||
# require CLI args. parse_args() runs at the start of __main__ only.
|
||||
args: argparse.Namespace = argparse.Namespace() # type: ignore[assignment]
|
||||
@@ -40,6 +41,10 @@ args: argparse.Namespace = argparse.Namespace() # type: ignore[assignment]
|
||||
|
||||
if __name__ == "__main__":
|
||||
args = parser.parse_args()
|
||||
from pathlib import Path
|
||||
from src.paths import set_config_override
|
||||
if args.config:
|
||||
set_config_override(Path(args.config).resolve())
|
||||
if args.web_host is not None:
|
||||
with startup_profiler.phase("web_host_imports"):
|
||||
from imgui_bundle import hello_imgui
|
||||
|
||||
Reference in New Issue
Block a user