Commit 4cfe0c4c82

4cfe0c4c8240070689e977c03b07795cb6cf8fbb

parent: 0e343a88e5

Verified · cmc

cmc <hello@cleberg.net> · 2026-09-12 06:00 UTC

control: status list and repo topics print rows

Ref #183
internal/control/repo.go +5 −3
@@ -141,7 +141,7 @@ func validQuery(q string) error {
141141// stay available so an archived repo can be managed and unarchived.
142142func refuseArchived(c *Ctx, repo store.Repo) int {
143143 if repo.Settings.Archived {
144 return c.fail(protocol.ExitDenied, "%s is archived and read-only", repo.Path())
144 return c.fail(protocol.ExitDenied, "%s is archived and read-only; unarchive it first", repo.Path())
145145 }
146146 return -1
147147}
@@ -165,7 +165,7 @@ func resolveRepo(c *Ctx, path string, check func(store.User, store.Repo, string)
165165 // Invisible repos 404, per the enumeration rule.
166166 return repo, c.fail(protocol.ExitNotFound, "repository %s not found", path)
167167 }
168 return repo, c.fail(protocol.ExitDenied, "permission denied on %s", path)
168 return repo, c.fail(protocol.ExitDenied, "permission denied on %s; ask its owner for access", path)
169169 }
170170 return repo, -1
171171}
@@ -846,7 +846,9 @@ func editTopics(c *Ctx, args []string, add bool) int {
846846 return c.fail(protocol.ExitFailure, "%v", err)
847847 }
848848 return c.emit(now, func(w io.Writer) {
849 fmt.Fprintf(w, "topics on %s: %s\n", repo.Path(), strings.Join(now, ", "))
849 for _, t := range now {
850 fmt.Fprintln(w, t)
851 }
850852 })
851853}
852854
internal/control/status.go +2 −6
@@ -118,13 +118,9 @@ func runStatusList(c *Ctx, args []string) int {
118118 Statuses []out `json:"statuses"`
119119 }{full, combinedOf(statuses), ds}
120120 return c.emit(d, func(w io.Writer) {
121 fmt.Fprintf(w, "%.10s: %s\n", d.SHA, orNone(d.Combined))
121 fmt.Fprintf(w, "combined\t%s\t%.10s\n", orNone(d.Combined), d.SHA)
122122 for _, x := range ds {
123 extra := ""
124 if x.Description != "" {
125 extra = "\t" + x.Description
126 }
127 fmt.Fprintf(w, " %s\t%s%s\n", x.Context, x.State, extra)
123 fmt.Fprintf(w, "%s\t%s\t%s\n", x.Context, x.State, x.Description)
128124 }
129125 })
130126}