Skip to content

Commit e3ecaea

Browse files
authored
describe command: update output to not show description if empty (#141)
1 parent 5aa3854 commit e3ecaea

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

internal/cmd/secrets-manager/user/describe/describe.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,14 @@ func outputResult(cmd *cobra.Command, outputFormat string, user secretsmanager.U
108108
table.AddSeparator()
109109
table.AddRow("USERNAME", *user.Username)
110110
table.AddSeparator()
111-
table.AddRow("DESCRIPTION", *user.Description)
112-
if user.Password != nil && *user.Password != "" {
111+
if user.Description != nil && *user.Description != "" {
112+
table.AddRow("DESCRIPTION", *user.Description)
113113
table.AddSeparator()
114+
}
115+
if user.Password != nil && *user.Password != "" {
114116
table.AddRow("PASSWORD", *user.Password)
117+
table.AddSeparator()
115118
}
116-
table.AddSeparator()
117119
table.AddRow("WRITE ACCESS", *user.Write)
118120

119121
err := table.Display(cmd)

0 commit comments

Comments
 (0)