From 846863ca66dfef58273ab0dce87202ea8bfb0ef3 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sat, 1 Apr 2017 14:33:49 +0200 Subject: [PATCH] lnd: avoid duplicating the help message (-h flag) --- lnd.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lnd.go b/lnd.go index 008da576..355508d3 100644 --- a/lnd.go +++ b/lnd.go @@ -17,6 +17,7 @@ import ( "google.golang.org/grpc" + flags "github.com/btcsuite/go-flags" proxy "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/lightningnetwork/lnd/chainntnfs/btcdnotify" "github.com/lightningnetwork/lnd/channeldb" @@ -225,7 +226,10 @@ func main() { // Call the "real" main in a nested manner so the defers will properly // be executed in the case of a graceful shutdown. if err := lndMain(); err != nil { - fmt.Fprintln(os.Stderr, err) + if e, ok := err.(*flags.Error); ok && e.Type == flags.ErrHelp { + } else { + fmt.Fprintln(os.Stderr, err) + } os.Exit(1) } }