lnd: move main method to cmd/lnd/main.go

This commit is contained in:
Johan T. Halseth
2019-01-24 14:28:25 +01:00
parent 6c60caa852
commit 9d1e1db42e
2 changed files with 28 additions and 18 deletions

21
cmd/lnd/main.go Normal file
View File

@@ -0,0 +1,21 @@
package main
import (
"fmt"
"os"
flags "github.com/jessevdk/go-flags"
"github.com/lightningnetwork/lnd"
)
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 := lnd.Main(); err != nil {
if e, ok := err.(*flags.Error); ok && e.Type == flags.ErrHelp {
} else {
fmt.Fprintln(os.Stderr, err)
}
os.Exit(1)
}
}