27 lines
554 B
Go
27 lines
554 B
Go
/*
|
|
* Copyright (C) 2019 Philipp Haefelfinger (http://www.haefelfinger.ch/). All Rights Reserved.
|
|
* This application is licensed under GPLv2. See the LICENSE file in the root directory of the project.
|
|
*/
|
|
|
|
package app
|
|
|
|
import "strings"
|
|
|
|
type arrayFlags []string
|
|
|
|
func (arr *arrayFlags) String() string {
|
|
b := strings.Builder{}
|
|
for _, v := range *arr {
|
|
if b.Len() > 0 {
|
|
b.WriteString(",")
|
|
}
|
|
b.WriteString(v)
|
|
}
|
|
return b.String()
|
|
}
|
|
|
|
func (arr *arrayFlags) Set(value string) error {
|
|
*arr = append(*arr, strings.TrimSpace(value))
|
|
return nil
|
|
}
|