mirror of
https://github.com/snowykami/server-status-client.git
synced 2024-11-22 15:18:00 +08:00
✨ 添加命令行工具
This commit is contained in:
parent
703fe75a76
commit
851242ce51
@ -19,7 +19,7 @@ requires = ["pdm-backend"]
|
||||
build-backend = "pdm.backend"
|
||||
|
||||
[project.scripts]
|
||||
server-status = "server_status.__main__"
|
||||
server-status = "server_status.__main__:main"
|
||||
|
||||
[tool.pdm]
|
||||
distribution = true
|
||||
|
@ -1,10 +1,10 @@
|
||||
import socket
|
||||
import sys
|
||||
|
||||
from server_status.api import *
|
||||
from server_status.cmd_parser import server_status_alc
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
def main():
|
||||
raw_msg = "server_status " + " ".join(sys.argv[1:])
|
||||
arp = server_status_alc.parse(raw_msg)
|
||||
|
||||
@ -35,3 +35,7 @@ if __name__ == "__main__":
|
||||
|
||||
else:
|
||||
log("Unknown command, use 'server_status --help' for help/未知命令或参数错误,请使用 'server_status --help' 获取帮助")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
Loading…
Reference in New Issue
Block a user