Files
devvm/internal/cli/msg.go
T
w3cjandClaude Opus 5.5 e182e3787a feat(ui): output helpers, spinner, run logs and cleanups
internal/ui is now the only package that prints: the message helpers,
prompts, tty detection, the status line, the run log (Logged, step
counts, proxy keys redacted) and ui.Main, which recovers Die, runs the
cleanup stack and handles INT/TERM/HUP (exit 130). main runs devvm
through it, and Cobra's errors print as one-line devvm errors.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 02:27:59 -06:00

32 lines
796 B
Go

package cli
import (
"fmt"
"github.com/spf13/cobra"
"github.com/w3cj/devvm/internal/msg"
"github.com/w3cj/devvm/internal/ui"
)
// newMsgCmd is devvm _msg NAME key=value...: a message's text, for the
// end-to-end tests to look for. Hidden: it's not for users.
func newMsgCmd() *cobra.Command {
return &cobra.Command{
Use: "_msg NAME [key=value...]",
Short: "Print a message's text",
Hidden: true,
DisableFlagParsing: true,
Args: cobra.MinimumNArgs(1),
RunE: func(_ *cobra.Command, args []string) error {
m, err := msg.FromArgs(args[0], args[1:])
if err != nil {
return err
}
// The text whatever DEVVM_MESSAGES says: it's data here.
_, err = fmt.Fprintln(ui.Stdout(), m.Text())
return err
},
}
}