cmdHamrpass: `/hamrpass` shows status + how-to, `/hamrpass ` validates, saves the key on the managed hamrpass profile, switches active, and pings the backend. Validation lives in hamrpassValidate so the popover hint and the inline error stay in lockstep.
(args []string)
| 280 | // cmdHamrpass: `/hamrpass` shows status + how-to, `/hamrpass <key>` validates, |
| 281 | // saves the key on the managed hamrpass profile, switches active, and pings the |
| 282 | // backend. Validation lives in hamrpassValidate so the popover hint and the |
| 283 | // inline error stay in lockstep. |
| 284 | func (m Model) cmdHamrpass(args []string) (tea.Model, tea.Cmd) { |
| 285 | if len(args) == 0 { |
| 286 | m.printHamrpassStatus() |
| 287 | return m, nil |
| 288 | } |
| 289 | if len(args) > 1 { |
| 290 | m.appendLine(styleError.Render("⚠ hamrpass keys cannot contain spaces")) |
| 291 | return m, nil |
| 292 | } |
| 293 | key, hint, ok := hamrpassValidate(args[0]) |
| 294 | if !ok { |
| 295 | m.appendLine(styleError.Render("⚠ " + hint)) |
| 296 | return m, nil |
| 297 | } |
| 298 | return m, m.activateHamrpass(key) |
| 299 | } |
| 300 |
nothing calls this directly
no test coverage detected