Skip to content

Commit

Permalink
Merge pull request #3230 from oasisprotocol/tjanez/cli-dont-print-err…
Browse files Browse the repository at this point in the history
…ors-twice

go: Fix CLI tools to not print error messages twice
  • Loading branch information
tjanez authored Sep 3, 2020
2 parents 9d1f222 + 5cbdac6 commit 704821d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions .changelog/3230.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go: Fix CLI tools to not print error messages twice
3 changes: 2 additions & 1 deletion go/extra/stats/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd

import (
"fmt"
"os"

"github.com/spf13/cobra"
flag "github.com/spf13/pflag"
Expand Down Expand Up @@ -38,7 +39,7 @@ func Execute() {
}

if err := rootCmd.Execute(); err != nil {
common.EarlyLogAndExit(err)
os.Exit(1)
}
}

Expand Down
2 changes: 1 addition & 1 deletion go/oasis-net-runner/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func RootCmd() *cobra.Command {
// Execute spawns the main entry point after handing the config file.
func Execute() {
if err := rootCmd.Execute(); err != nil {
common.EarlyLogAndExit(err)
os.Exit(1)
}
}

Expand Down
3 changes: 2 additions & 1 deletion go/oasis-node/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
package cmd

import (
"os"
"syscall"

"github.com/spf13/cobra"
Expand Down Expand Up @@ -41,7 +42,7 @@ func Execute() {
syscall.Umask(0o077)

if err := rootCmd.Execute(); err != nil {
cmdCommon.EarlyLogAndExit(err)
os.Exit(1)
}
}

Expand Down
2 changes: 1 addition & 1 deletion go/oasis-remote-signer/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var (
// Execute spawns the main entry point after handling the config file.
func Execute() {
if err := rootCmd.Execute(); err != nil {
cmdCommon.EarlyLogAndExit(err)
os.Exit(1)
}
}

Expand Down

0 comments on commit 704821d

Please sign in to comment.