fix(photon): correct gateway start command (#45566)
This commit is contained in:
@@ -14,6 +14,21 @@ from typing import Callable
|
||||
from hermes_cli.subcommands._shared import add_accept_hooks_flag
|
||||
|
||||
|
||||
def _add_compat_platform_flag(parser: argparse.ArgumentParser) -> None:
|
||||
"""Accept stale `gateway <verb> --platform X` docs without advertising it.
|
||||
|
||||
Gateway service lifecycle commands operate on the gateway process, not a
|
||||
single messaging adapter. Photon briefly printed a per-platform start
|
||||
command during setup; keep that command parseable so users following the
|
||||
old hint don't get blocked by argparse before the gateway can start.
|
||||
"""
|
||||
parser.add_argument(
|
||||
"--platform",
|
||||
dest="platform",
|
||||
help=argparse.SUPPRESS,
|
||||
)
|
||||
|
||||
|
||||
def build_gateway_parser(subparsers, *, cmd_gateway: Callable, cmd_proxy: Callable) -> None:
|
||||
"""Attach the ``gateway`` and ``proxy`` subcommands to ``subparsers``."""
|
||||
# =========================================================================
|
||||
@@ -75,6 +90,7 @@ def build_gateway_parser(subparsers, *, cmd_gateway: Callable, cmd_proxy: Callab
|
||||
action="store_true",
|
||||
help="Kill ALL stale gateway processes across all profiles before starting",
|
||||
)
|
||||
_add_compat_platform_flag(gateway_start)
|
||||
|
||||
# gateway stop
|
||||
gateway_stop = gateway_subparsers.add_parser("stop", help="Stop gateway service")
|
||||
@@ -103,6 +119,7 @@ def build_gateway_parser(subparsers, *, cmd_gateway: Callable, cmd_proxy: Callab
|
||||
action="store_true",
|
||||
help="Kill ALL gateway processes across all profiles before restarting",
|
||||
)
|
||||
_add_compat_platform_flag(gateway_restart)
|
||||
|
||||
# gateway status
|
||||
gateway_status = gateway_subparsers.add_parser("status", help="Show gateway status")
|
||||
@@ -118,6 +135,7 @@ def build_gateway_parser(subparsers, *, cmd_gateway: Callable, cmd_proxy: Callab
|
||||
action="store_true",
|
||||
help="Target the Linux system-level gateway service",
|
||||
)
|
||||
_add_compat_platform_flag(gateway_status)
|
||||
|
||||
# gateway install
|
||||
gateway_install = gateway_subparsers.add_parser(
|
||||
|
||||
Reference in New Issue
Block a user