Skip to content

Commit

Permalink
minute catch all
Browse files Browse the repository at this point in the history
  • Loading branch information
drgrib committed Mar 18, 2017
1 parent 8f56989 commit cd44201
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ttimer.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,14 @@ func parseArgs(t, z string) (time.Duration, string) {
title := fmt.Sprintf("%v Timer", t)
return d, title
}
// else

// parse as minute
minutes, err := strconv.Atoi(t)
if err != nil {
break
}
d = time.Duration(minutes) * time.Minute
title := fmt.Sprintf("%vm Timer", t)
return d, title
}
fmt.Printf(
"%#v couldn't be parsed, starting 1m timer\n", t)
Expand Down

0 comments on commit cd44201

Please sign in to comment.