update cli
This commit is contained in:
parent
7eb5cdbf92
commit
6ee2c90464
4
cli.go
4
cli.go
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user