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:
@@ -36,14 +36,17 @@ func accountShow(st *store.Store, rest []string, out, errOut io.Writer) int {
|
||||
if subj == "" {
|
||||
subj = "(none)"
|
||||
}
|
||||
fmt.Fprintf(out, "name: %s\n", a.Name)
|
||||
fmt.Fprintf(out, "mode: %s\n", a.Mode)
|
||||
fmt.Fprintf(out, "imap: %s:%d (%s)\n", a.IMAPHost, a.IMAPPort, a.IMAPSecurity)
|
||||
fmt.Fprintf(out, "smtp: %s\n", smtp)
|
||||
fmt.Fprintf(out, "username: %s\n", a.Username)
|
||||
fmt.Fprintf(out, "send-from: %s\n", a.SendFrom())
|
||||
fmt.Fprintf(out, "subject filter: %s\n", subj)
|
||||
fmt.Fprintf(out, "inbound whitelist: %s\n", onOff(a.WhitelistInEnabled))
|
||||
fmt.Fprintf(out, "outbound whitelist: %s\n", onOff(a.WhitelistOutEnabled))
|
||||
// Labels padded to the width of the longest ("outbound whitelist:") so
|
||||
// every value aligns in one column.
|
||||
const lbl = "%-19s %s\n"
|
||||
fmt.Fprintf(out, lbl, "name:", a.Name)
|
||||
fmt.Fprintf(out, lbl, "mode:", a.Mode)
|
||||
fmt.Fprintf(out, lbl, "imap:", fmt.Sprintf("%s:%d (%s)", a.IMAPHost, a.IMAPPort, a.IMAPSecurity))
|
||||
fmt.Fprintf(out, lbl, "smtp:", smtp)
|
||||
fmt.Fprintf(out, lbl, "username:", a.Username)
|
||||
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user