cli: implement AddressFlag

This makes code less verbose and performs all parsing
before invoking main function.
This commit is contained in:
Evgenii Stratonikov 2020-03-03 23:09:47 +03:00
parent f8eee778f4
commit 9be4312d8d
3 changed files with 103 additions and 23 deletions

11
cli/flags/util.go Normal file
View file

@ -0,0 +1,11 @@
package flags
import "strings"
func eachName(longName string, fn func(string)) {
parts := strings.Split(longName, ",")
for _, name := range parts {
name = strings.Trim(name, " ")
fn(name)
}
}