MCPcopy Create free account
hub / github.com/codehamr/codehamr / commandByName

Function commandByName

internal/tui/slash.go:73–80  ·  view source on GitHub ↗

commandByName returns the registered command for a slash name, or nil. Centralises the linear scan shared by completion, dispatch, and runSlash.

(name string)

Source from the content-addressed store, hash-verified

71// commandByName returns the registered command for a slash name, or nil.
72// Centralises the linear scan shared by completion, dispatch, and runSlash.
73func commandByName(name string) *command {
74 for i := range commands {
75 if commands[i].name == name {
76 return &commands[i]
77 }
78 }
79 return nil
80}
81
82// runSlash dispatches a slash-prefixed submission; unknown commands produce a
83// quiet hint, not an error. config.yaml is re-read before every slash so

Callers 4

handleTabMethod · 0.85
handleEnterMethod · 0.85
runSlashMethod · 0.85
refreshSuggestMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected