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

Function hamrpassArgHint

internal/tui/slash.go:264–276  ·  view source on GitHub ↗

hamrpassArgHint is the args callback for /hamrpass: one synthetic row whose value mirrors the typed argument and whose description carries the live validation hint. Mirroring keeps the row alive: refreshSuggest filters via HasPrefix(value, prefix), and HasPrefix(x, x) is always true.

(m Model)

Source from the content-addressed store, hash-verified

262// hamrpassArgHint is the args callback for /hamrpass: one synthetic row whose
263// value mirrors the typed argument and whose description carries the live
264// validation hint. Mirroring keeps the row alive: refreshSuggest filters via
265// HasPrefix(value, prefix), and HasPrefix(x, x) is always true.
266func hamrpassArgHint(m Model) []argOption {
267 _, rest, _ := strings.Cut(m.ta.Value(), " ")
268 rest = strings.TrimLeft(rest, " ")
269 _, hint, ok := hamrpassValidate(rest)
270 mark := "· "
271 switch {
272 case ok:
273 mark = "✓ "
274 case rest != "":
275 mark = "✗ "
276 }
277 return []argOption{{value: rest, description: mark + hint}}
278}
279

Callers

nothing calls this directly

Calls 2

hamrpassValidateFunction · 0.85
ValueMethod · 0.80

Tested by

no test coverage detected