This commit is contained in:
2025-11-02 01:04:31 +03:00
parent 64c984a704
commit 9c58c10152
70 changed files with 341 additions and 391 deletions
+18 -13
View File
@@ -3,26 +3,31 @@ from argenta.command import Flag, Flags
router = Router(title="Server Management")
@router.command(Command(
"start",
description="Start the server",
flags=Flags([
Flag("port", help="Server port", default="8080"),
Flag("host", help="Server host", default="localhost"),
Flag("debug", help="Enable debug mode")
]),
aliases=["run"]
))
@router.command(
Command(
"start",
description="Start the server",
flags=Flags(
[
Flag("port", help="Server port", default="8080"),
Flag("host", help="Server host", default="localhost"),
Flag("debug", help="Enable debug mode"),
]
),
aliases=["run"],
)
)
def handle_start(response: Response):
input_flags = response.input_flags
port_flag = input_flags.get_flag_by_name("port")
host_flag = input_flags.get_flag_by_name("host")
debug_flag = input_flags.get_flag_by_name("debug")
host = host_flag.input_value if host_flag else "localhost"
port = port_flag.input_value if port_flag else "8080"
debug = debug_flag and debug_flag.input_value
print(f"Starting server on {host}:{port}")
if debug:
print("Debug mode: ON")
print("Debug mode: ON")