File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,7 +42,11 @@ func main() {
4242 fmt .Fprintf (os .Stderr , "%s\n " , err .Error ())
4343 }
4444 } else {
45- fmt .Fprintf (os .Stderr , "%s\n " , err .Error ())
45+ if cmd .CommandErrorBuffer .Len () > 0 {
46+ os .Stderr .Write (cmd .CommandErrorBuffer .Bytes ())
47+ } else {
48+ fmt .Fprintf (os .Stderr , "%s\n " , err .Error ())
49+ }
4650 }
4751 os .Exit (exitCode )
4852 }
Original file line number Diff line number Diff line change 33package cmd
44
55import (
6+ "bytes"
67 "compress/gzip"
78 "context"
89 "fmt"
@@ -18,15 +19,17 @@ import (
1819)
1920
2021var (
21- Command * cli.Command
22+ Command * cli.Command
23+ CommandErrorBuffer bytes.Buffer
2224)
2325
2426func init () {
2527 Command = & cli.Command {
26- Name : "beeper-desktop-cli" ,
27- Usage : "CLI for the beeperdesktop API" ,
28- Suggest : true ,
29- Version : Version ,
28+ Name : "beeper-desktop-cli" ,
29+ Usage : "CLI for the beeperdesktop API" ,
30+ Suggest : true ,
31+ Version : Version ,
32+ ErrWriter : & CommandErrorBuffer ,
3033 Flags : []cli.Flag {
3134 & cli.BoolFlag {
3235 Name : "debug" ,
You can’t perform that action at this time.
0 commit comments