From c55152ef7ebad34f3325de4e0bb2883b628afd9b Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Tue, 22 Oct 2013 10:01:13 -0500 Subject: [PATCH] Always return non-zero code from btcctl on error. --- util/btcctl/btcctl.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/btcctl/btcctl.go b/util/btcctl/btcctl.go index 3007ca74..bfb67f56 100644 --- a/util/btcctl/btcctl.go +++ b/util/btcctl/btcctl.go @@ -210,7 +210,6 @@ func usage(parser *flags.Parser) { "\tgetrawmempool\n"+ "\tgetrawtransaction [verbose=0]\n"+ "\tstop\n") - os.Exit(1) } func main() { @@ -224,7 +223,7 @@ func main() { if e, ok := err.(*flags.Error); !ok || e.Type != flags.ErrHelp { usage(parser) } - return + os.Exit(1) } if cfg.Help { usage(parser) @@ -236,7 +235,7 @@ func main() { if !exists { fmt.Fprintf(os.Stderr, "Unrecognized command: %s\n", args[0]) usage(parser) - return + os.Exit(1) } // Execute the command. @@ -244,9 +243,10 @@ func main() { if err != nil { if err == ErrUsage { usage(parser) - return + os.Exit(1) } fmt.Fprintf(os.Stderr, "%v\n", err) + os.Exit(1) } }