update cli

This commit is contained in:
白茶清欢 2024-06-18 12:24:05 +08:00
parent 7eb5cdbf92
commit 6ee2c90464

4
cli.go
View File

@ -23,7 +23,9 @@ type cli struct {
func (c *cli) ParseCLIParameter(parameterNameList []string) map[string]string {
cliParameterTable := make(map[string]*string)
for _, parameterName := range parameterNameList {
cliParameterTable[parameterName] = flag.String(parameterName, "", parameterName)
var val string
flag.StringVar(&val, parameterName, "", parameterName)
cliParameterTable[parameterName] = &val
}
// 这里有一个非常中的操作,转换,必须调用该方法
flag.Parse()