Commit 268ee37
authored
fix: direct CLI output to stdout instead of stderr (#121)
Fixes #120
Cobra's cmd.Print* methods default to stderr when no output writer
is set. This causes commands like 'batt status' to write their output
to stderr, making redirection (e.g., 'batt status > file.txt')
capture nothing.
Adding cmd.SetOut(os.Stdout) ensures normal command output goes to
stdout while errors and diagnostics remain on stderr.1 parent 96372f8 commit 268ee37
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
139 | 145 | | |
140 | 146 | | |
141 | 147 | | |
| |||
0 commit comments