Update command.go

Added comments to explain output logic
This commit is contained in:
Rose Thatcher 2023-08-01 08:57:56 -05:00 committed by GitHub
parent d66af4f082
commit 2a84b71b82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,6 +47,8 @@ func (o Options) Run() error {
}
if o.ShowOutput {
// BubbleTea writes the View() to stderr.
// If the program is being piped then put the accumulated output in stdout.
if !isTTY {
_, err := os.Stdout.WriteString(m.stdout)
if err != nil {