blob: ba6d92eaf740c7c01a27461ef7e5de691366fec4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
package main
import (
"strings"
)
// MultiStringFlag implements the flag.Value interface and allows a string flag
// to be specified multiple times on the command line.
//
// e.g.: -listen-http 127.0.0.1:80 -listen-http [::1]:80
type MultiStringFlag []string
// String returns the list of parameters joined with a commas (",")
func (s *MultiStringFlag) String() string {
return strings.Join(*s, ",")
}
// Set appends the value to the list of parameters
func (s *MultiStringFlag) Set(value string) error {
*s = append(*s, value)
return nil
}
|