mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-03 11:41:48 +00:00
cli: implement AddressFlag
This makes code less verbose and performs all parsing before invoking main function.
This commit is contained in:
parent
f8eee778f4
commit
9be4312d8d
3 changed files with 103 additions and 23 deletions
11
cli/flags/util.go
Normal file
11
cli/flags/util.go
Normal 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)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue