mirror of
https://github.com/hashicorp/vault.git
synced 2025-12-16 15:01:13 +01:00
Address review feedback
This commit is contained in:
parent
c3a70bc1bf
commit
143d876c99
@ -37,15 +37,11 @@ func (c *TokenRenewCommand) Run(args []string) int {
|
||||
}
|
||||
|
||||
var inc int
|
||||
// If both are specified prefer the argument
|
||||
if len(args) == 2 {
|
||||
dur, err := time.ParseDuration(args[1])
|
||||
if err != nil {
|
||||
c.Ui.Error(fmt.Sprintf("Invalid increment: %s", err))
|
||||
return 1
|
||||
}
|
||||
|
||||
inc = int(dur / time.Second)
|
||||
} else if increment != "" {
|
||||
increment = args[1]
|
||||
}
|
||||
if increment != "" {
|
||||
dur, err := time.ParseDuration(increment)
|
||||
if err != nil {
|
||||
c.Ui.Error(fmt.Sprintf("Invalid increment: %s", err))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user