新增name命令参数

This commit is contained in:
orgin
2022-04-19 09:26:11 +08:00
parent 18d620118e
commit 13642d7402

View File

@@ -39,6 +39,7 @@ func init() {
signal.Notify(sig, syscall.SIGINT, syscall.SIGTERM,syscall.Signal(10)) signal.Notify(sig, syscall.SIGINT, syscall.SIGTERM,syscall.Signal(10))
console.RegisterCommandBool("help",false,"<-help> This help.",usage) console.RegisterCommandBool("help",false,"<-help> This help.",usage)
console.RegisterCommandString("name","","<-name nodeName> Node's name.",setName)
console.RegisterCommandString("start","","<-start nodeid=nodeid> Run originserver.",startNode) console.RegisterCommandString("start","","<-start nodeid=nodeid> Run originserver.",startNode)
console.RegisterCommandString("stop","","<-stop nodeid=nodeid> Stop originserver process.",stopNode) console.RegisterCommandString("stop","","<-stop nodeid=nodeid> Stop originserver process.",stopNode)
console.RegisterCommandString("config","","<-config path> Configuration file path.",setConfigPath) console.RegisterCommandString("config","","<-config path> Configuration file path.",setConfigPath)
@@ -64,6 +65,10 @@ func usage(val interface{}) error{
return nil return nil
} }
func setName(val interface{}) error {
return nil
}
func setPprof(val interface{}) error { func setPprof(val interface{}) error {
listenAddr := val.(string) listenAddr := val.(string)
if listenAddr==""{ if listenAddr==""{