Address review feedback

This commit is contained in:
Jeff Mitchell 2016-03-01 20:25:40 -05:00
parent c3a70bc1bf
commit 143d876c99

View File

@ -37,15 +37,11 @@ func (c *TokenRenewCommand) Run(args []string) int {
} }
var inc int var inc int
// If both are specified prefer the argument
if len(args) == 2 { if len(args) == 2 {
dur, err := time.ParseDuration(args[1]) increment = args[1]
if err != nil { }
c.Ui.Error(fmt.Sprintf("Invalid increment: %s", err)) if increment != "" {
return 1
}
inc = int(dur / time.Second)
} else if increment != "" {
dur, err := time.ParseDuration(increment) dur, err := time.ParseDuration(increment)
if err != nil { if err != nil {
c.Ui.Error(fmt.Sprintf("Invalid increment: %s", err)) c.Ui.Error(fmt.Sprintf("Invalid increment: %s", err))