From 8c3866ea16348d49679b6f74b27f1a0b28275e0a Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Tue, 17 May 2016 17:10:12 +0000 Subject: [PATCH] Rename lease_duration to refresh_interval when there is no lease ID, and output ---- between header and values --- command/format.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/command/format.go b/command/format.go index 93b812312e..ee7145249a 100644 --- a/command/format.go +++ b/command/format.go @@ -129,12 +129,17 @@ func (t TableFormatter) OutputSecret(ui cli.Ui, secret, s *api.Secret) error { input = append(input, fmt.Sprintf("Key %s Value", config.Delim)) + input = append(input, fmt.Sprintf("--- %s -----", config.Delim)) + if s.LeaseDuration > 0 { if s.LeaseID != "" { input = append(input, fmt.Sprintf("lease_id %s %s", config.Delim, s.LeaseID)) + input = append(input, fmt.Sprintf( + "lease_duration %s %d", config.Delim, s.LeaseDuration)) + } else { + input = append(input, fmt.Sprintf( + "refresh_interval %s %d", config.Delim, s.LeaseDuration)) } - input = append(input, fmt.Sprintf( - "lease_duration %s %d", config.Delim, s.LeaseDuration)) if s.LeaseID != "" { input = append(input, fmt.Sprintf( "lease_renewable %s %s", config.Delim, strconv.FormatBool(s.Renewable)))