Commit fd270da6d7

fd270da6d7c75451881384de97db687ebe22a8fc

parent: ba0a7d33f3

Verified · cmc

cmc <hello@cleberg.net> · 2026-09-28 08:30 UTC

help: no auth <verb> usage or footer over stock ssh

The server has no auth command; each row already names its full path.

Ref #267

Layout: unified · split

internal/control/help.go +13 −5
@@ -330,10 +330,16 @@ func (c *Ctx) helpVerb(w io.Writer, cmd Command, below []Command) {
330330func (c *Ctx) helpNoun(w io.Writer, prefix string, cmds []Command, override map[string]string) {
331331 head := nounSummaries[strings.Fields(prefix)[0]]
332332 fmt.Fprintln(w, head)
333 fmt.Fprintln(w)
334 c.heading(w, "USAGE")
333 // An aliased noun is a CLI grouping: over stock ssh there is no
334 // "auth <verb>" to type, and each row already names its full command.
335 _, aliased := nounAliases[prefix]
336 bare := aliased && c.CLIPath == ""
335337 display := c.shownAs(prefix, prefix)
336 fmt.Fprintf(w, " %s %s <verb> ...\n", c.program(), display)
338 if !bare {
339 fmt.Fprintln(w)
340 c.heading(w, "USAGE")
341 fmt.Fprintf(w, " %s %s <verb> ...\n", c.program(), display)
342 }
337343 rowText := func(cmd Command) string {
338344 full := joinPath(cmd.Path)
339345 if ov, ok := override[full]; ok {
@@ -362,6 +368,8 @@ func (c *Ctx) helpNoun(w io.Writer, prefix string, cmds []Command, override map[
362368 fmt.Fprintf(w, " %s %s\n", pad(rowText(cmd), wide), cmd.Summary)
363369 }
364370 }
365 fmt.Fprintln(w)
366 fmt.Fprintf(w, "%s %s <verb> --help for flags.\n", c.program(), display)
371 if !bare {
372 fmt.Fprintln(w)
373 fmt.Fprintf(w, "%s %s <verb> --help for flags.\n", c.program(), display)
374 }
367375}
internal/control/help_test.go +3
@@ -270,4 +270,7 @@ func TestHelpRendersAnAliasedNounInRegisteredFormOverSSH(t *testing.T) {
270270 if strings.Contains(got, "auth keys list") {
271271 t.Errorf("stock ssh should not see the CLI-only auth prefix: %s", got)
272272 }
273 if strings.Contains(got, " auth <verb>") {
274 t.Errorf("stock ssh should not be told to type auth <verb>, which the server has no command for: %s", got)
275 }
273276}