mirror of
https://github.com/hashicorp/vault.git
synced 2025-12-17 07:21:18 +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
|
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))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user