Skip to content

Commit

Permalink
fix dest option parsing at drain command
Browse files Browse the repository at this point in the history
  • Loading branch information
cenkalti committed Apr 10, 2018
1 parent f7237c9 commit cafc137
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,15 @@ func main() {
if err != nil {
return err
}
for _, devidString := range strings.Split(c.String("dest"), ",") {
devid, err := strconv.ParseInt(strings.TrimSpace(devidString), 10, 64)
if err != nil {
return err
destFlag := c.String("dest")
if destFlag != "" {
for _, devidString := range strings.Split(destFlag, ",") {
devid, err := strconv.ParseInt(strings.TrimSpace(devidString), 10, 64)
if err != nil {
return err
}
d.Dest = append(d.Dest, devid)
}
d.Dest = append(d.Dest, devid)
}
runUntilInterrupt(d)
return nil
Expand Down

0 comments on commit cafc137

Please sign in to comment.