diff --git a/dgraph/cmd/bulk/run.go b/dgraph/cmd/bulk/run.go index 565652c2196..de9eafdaded 100644 --- a/dgraph/cmd/bulk/run.go +++ b/dgraph/cmd/bulk/run.go @@ -98,7 +98,8 @@ func run() { } if opt.Version { - x.PrintVersionOnly() + x.PrintVersion() + os.Exit(0) } if opt.RDFDir == "" || opt.SchemaFile == "" { flag.Usage() diff --git a/dgraph/cmd/root.go b/dgraph/cmd/root.go index 51c1045c893..1b6a4b9147d 100644 --- a/dgraph/cmd/root.go +++ b/dgraph/cmd/root.go @@ -27,7 +27,7 @@ var RootCmd = &cobra.Command{ Use: "dgraph", Short: "Dgraph: Distributed Graph Database", Long: ` -Dgraph is an open source, horizontally scalable and distributed graph database, +Dgraph is a horizontally scalable and distributed graph database, providing ACID transactions, consistent replication and linearizable reads. It's built from ground up to perform for a rich set of queries. Being a native graph database, it tightly controls how the data is arranged on disk to optimize diff --git a/dgraph/cmd/server/run.go b/dgraph/cmd/server/run.go index c31f797262c..2d2f07b88a4 100644 --- a/dgraph/cmd/server/run.go +++ b/dgraph/cmd/server/run.go @@ -311,6 +311,7 @@ func run() { x.Init(edgraph.Config.DebugMode) x.Config.QueryEdgeLimit = cast.ToUint64(Server.Conf.GetString("query_edge_limit")) + x.PrintVersion() edgraph.InitServerState() defer func() { x.Check(edgraph.State.Dispose()) diff --git a/dgraph/cmd/version/run.go b/dgraph/cmd/version/run.go index eb300d9a71a..49955b2afa2 100644 --- a/dgraph/cmd/version/run.go +++ b/dgraph/cmd/version/run.go @@ -8,6 +8,8 @@ package version import ( + "os" + "github.com/spf13/cobra" "github.com/dgraph-io/dgraph/x" @@ -21,7 +23,8 @@ func init() { Short: "Prints the dgraph version details", Long: "Version prints the dgraph version as reported by the build details.", Run: func(cmd *cobra.Command, args []string) { - x.PrintVersionOnly() + x.PrintVersion() + os.Exit(0) }, } } diff --git a/dgraph/cmd/zero/run.go b/dgraph/cmd/zero/run.go index 4cb3680e045..bcb6e027432 100644 --- a/dgraph/cmd/zero/run.go +++ b/dgraph/cmd/zero/run.go @@ -130,6 +130,7 @@ func (st *state) serveGRPC(l net.Listener, wg *sync.WaitGroup, store *raftwal.Di } func run() { + x.PrintVersion() opts = options{ bindall: Zero.Conf.GetBool("bindall"), myAddr: Zero.Conf.GetString("my"), diff --git a/x/init.go b/x/init.go index 646fc811854..c3a7597fdc7 100644 --- a/x/init.go +++ b/x/init.go @@ -9,7 +9,6 @@ package x import ( "fmt" - "os" ) var ( @@ -67,9 +66,8 @@ Licensed under Apache 2.0 + Commons Clause. Copyright 2015-2018 Dgraph Labs, Inc } // PrintVersionOnly prints version and other helpful information if --version. -func PrintVersionOnly() { +func PrintVersion() { fmt.Println(BuildDetails()) - os.Exit(0) } func Version() string {