server-status-client/server_status/cmd_parser.py
Snowykami 48ac46bbb3
Some checks failed
Compile / build (x64, windows-latest) (push) Failing after 43s
Compile / build (x64, ubuntu-latest) (push) Failing after 2m8s
增加客户端启动日志并优化线程启动逻辑
2024-12-09 00:26:16 +08:00

23 lines
949 B
Python

import platform
import socket
from arclet.alconna import Alconna, Subcommand, Option, Args, MultiVar
server_status_alc = Alconna( # type: ignore
"server_status",
Args["server", str]["token", str]["id", str],
Subcommand(
"run",
Option("-n|--name", Args["name", str, socket.gethostname()], help_text="Host name/主机名称"),
Option("--location", Args["location", str, "Unknown"], help_text="Host location/主机地理位置"),
Option("--labels", Args["labels", MultiVar(str), [platform.system()]], help_text="Host labels/主机标签"),
Option("--link", Args["link", str, None], help_text="Server address/服务器地址"),
Option("--interval", Args["interval", int, 5], help_text="Interval to send data: 5/发送数据的间隔: 5"),
help_text="Run the client/运行客户端",
),
Subcommand(
"rm",
help_text="Remove the host/移除主机",
),
)