zitadel/internal/config/array_flag.go

22 lines
377 B
Go
Raw Normal View History

2020-03-25 06:58:58 +00:00
package config
2020-03-27 12:44:50 +00:00
import (
"flag"
"strings"
)
2020-03-25 06:58:58 +00:00
2020-03-27 12:44:50 +00:00
var _ flag.Value = (*ArrayFlags)(nil)
//ArrayFlags implements the flag/Value interface
//allowing to set multiple string flags with the same name
2020-03-25 06:58:58 +00:00
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
}