zitadel/internal/config/array_flag.go
2020-03-27 13:44:50 +01:00

22 lines
377 B
Go

package config
import (
"flag"
"strings"
)
var _ flag.Value = (*ArrayFlags)(nil)
//ArrayFlags implements the flag/Value interface
//allowing to set multiple string flags with the same name
type ArrayFlags []string
func (i *ArrayFlags) String() string {
return strings.Join(*i, ";")
}
func (i *ArrayFlags) Set(value string) error {
*i = append(*i, value)
return nil
}