Commit faf8245dca

faf8245dcabc6969535e0391370aca2752f70fab

parent: b8cd3fd9d0

Verified · cmc

cmc <hello@cleberg.net> · 2026-09-24 02:03 UTC

control: fingerprint columns and help summaries fit a narrow terminal

Ref #254
internal/control/control.go +7 −1
@@ -352,7 +352,13 @@ func runHelp(c *Ctx, args []string) int {
352352 slices.SortFunc(matched, func(a, b helpEntry) int { return strings.Compare(a.Path, b.Path) })
353353 return c.emit(matched, func(w io.Writer) {
354354 for _, e := range matched {
355 fmt.Fprintf(w, "%-24s %s\n", e.Path, e.Summary)
355 summary := e.Summary
356 if c.Term.Cols > 0 {
357 if avail := c.Term.Cols - max(cells(e.Path), 24) - 1; avail > 0 {
358 summary = clip(summary, avail)
359 }
360 }
361 fmt.Fprintf(w, "%-24s %s\n", e.Path, summary)
356362 if prefix != "" {
357363 fmt.Fprintf(w, " %s\n", e.Usage)
358364 }
internal/control/deploykey.go +1 −1
@@ -100,7 +100,7 @@ func runDeployKeyList(c *Ctx, args []string) int {
100100 return c.emit(ds, func(w io.Writer) {
101101 tb := c.table(w, "FINGERPRINT", "ALGO", "MODE", "LABEL")
102102 for _, d := range ds {
103 tb.row(cRef(d.Fingerprint), cText(d.Algo), cState(d.Mode), cText(d.Label))
103 tb.row(cFlex(d.Fingerprint), cText(d.Algo), cState(d.Mode), cText(d.Label))
104104 }
105105 tb.flush()
106106 })
internal/control/identity.go +1 −1
@@ -85,7 +85,7 @@ func runKeysList(c *Ctx, args []string) int {
8585 return c.emit(ds, func(w io.Writer) {
8686 tb := c.table(w, "FINGERPRINT", "ALGO", "SCOPE", "LABEL")
8787 for _, d := range ds {
88 tb.row(cRef(d.Fingerprint), cText(d.Algo), cState(d.Scope), cText(d.Label))
88 tb.row(cFlex(d.Fingerprint), cText(d.Algo), cState(d.Scope), cText(d.Label))
8989 }
9090 tb.flush()
9191 })