mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 21:36:40 -10:00
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]>
39 lines
1.1 KiB
Plaintext
39 lines
1.1 KiB
Plaintext
# devvm _msg prints a message's text.
|
|
exec devvm _msg msg_unknown name=x
|
|
stdout '^no message x$'
|
|
! stderr .
|
|
|
|
# Values are kept as given, spaces and = included.
|
|
exec devvm _msg msg_unknown 'name=a b=c'
|
|
stdout '^no message a b=c$'
|
|
|
|
# Names mode doesn't change _msg's text.
|
|
env DEVVM_MESSAGES=names
|
|
exec devvm _msg msg_unknown name=x
|
|
stdout '^no message x$'
|
|
|
|
# Its errors are messages too: an unknown message, a missing, unexpected or
|
|
# repeated value, an argument that isn't name=value.
|
|
! exec devvm _msg nope
|
|
stderr '^devvm: msg_unknown name=nope$'
|
|
! stdout .
|
|
! exec devvm _msg msg_unknown
|
|
stderr 'msg_missing_value key=name name=msg_unknown$'
|
|
! exec devvm _msg msg_unknown name=x vm=y
|
|
stderr 'msg_unexpected_value key=vm name=msg_unknown$'
|
|
! exec devvm _msg msg_unknown name=x name=y
|
|
stderr 'msg_repeated_value key=name$'
|
|
! exec devvm _msg msg_unknown x
|
|
stderr 'msg_not_pair arg=x$'
|
|
! exec devvm _msg
|
|
stderr '^devvm: usage_error reason=requires at least 1 arg\(s\), only received 0$'
|
|
|
|
# Without names mode, errors are the text.
|
|
env DEVVM_MESSAGES=
|
|
! exec devvm _msg nope
|
|
stderr '^devvm: no message nope$'
|
|
|
|
# _msg isn't in the help.
|
|
exec devvm --help
|
|
! stdout _msg
|