style(cli): align account show columns with consistent label width

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-27 12:43:14 +01:00
parent 5476c04443
commit 87555fdc4d
+12 -9
View File
@@ -36,14 +36,17 @@ func accountShow(st *store.Store, rest []string, out, errOut io.Writer) int {
if subj == "" { if subj == "" {
subj = "(none)" subj = "(none)"
} }
fmt.Fprintf(out, "name: %s\n", a.Name) // Labels padded to the width of the longest ("outbound whitelist:") so
fmt.Fprintf(out, "mode: %s\n", a.Mode) // every value aligns in one column.
fmt.Fprintf(out, "imap: %s:%d (%s)\n", a.IMAPHost, a.IMAPPort, a.IMAPSecurity) const lbl = "%-19s %s\n"
fmt.Fprintf(out, "smtp: %s\n", smtp) fmt.Fprintf(out, lbl, "name:", a.Name)
fmt.Fprintf(out, "username: %s\n", a.Username) fmt.Fprintf(out, lbl, "mode:", a.Mode)
fmt.Fprintf(out, "send-from: %s\n", a.SendFrom()) fmt.Fprintf(out, lbl, "imap:", fmt.Sprintf("%s:%d (%s)", a.IMAPHost, a.IMAPPort, a.IMAPSecurity))
fmt.Fprintf(out, "subject filter: %s\n", subj) fmt.Fprintf(out, lbl, "smtp:", smtp)
fmt.Fprintf(out, "inbound whitelist: %s\n", onOff(a.WhitelistInEnabled)) fmt.Fprintf(out, lbl, "username:", a.Username)
fmt.Fprintf(out, "outbound whitelist: %s\n", onOff(a.WhitelistOutEnabled)) fmt.Fprintf(out, lbl, "send-from:", a.SendFrom())
fmt.Fprintf(out, lbl, "subject filter:", subj)
fmt.Fprintf(out, lbl, "inbound whitelist:", onOff(a.WhitelistInEnabled))
fmt.Fprintf(out, lbl, "outbound whitelist:", onOff(a.WhitelistOutEnabled))
return 0 return 0
} }