value of a container option (e.g. array) is reset to empty on first specification
This commit is contained in:
@@ -55,6 +55,8 @@ func (opt *cliOptionStringArray) parse(parser cliParser, argIndex int, valuePtr
|
||||
} else {
|
||||
err = errInvalidOptionValue(opt.name, boxedValue, "array of string")
|
||||
}
|
||||
} else if opt.alreadySeen {
|
||||
*opt.targetVar = append(*opt.targetVar, strings.Split(value, ",")...)
|
||||
} else {
|
||||
*opt.targetVar = strings.Split(value, ",")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user