Skip to content

Commit

Permalink
Print version when running Dgraph.
Browse files Browse the repository at this point in the history
  • Loading branch information
manishrjain committed Jul 18, 2018
1 parent 8359eb6 commit e2783d6
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion dgraph/cmd/bulk/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ func run() {
}

if opt.Version {
x.PrintVersionOnly()
x.PrintVersion()
os.Exit(0)
}
if opt.RDFDir == "" || opt.SchemaFile == "" {
flag.Usage()
Expand Down
2 changes: 1 addition & 1 deletion dgraph/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions dgraph/cmd/server/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
5 changes: 4 additions & 1 deletion dgraph/cmd/version/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
package version

import (
"os"

"github.com/spf13/cobra"

"github.com/dgraph-io/dgraph/x"
Expand All @@ -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)
},
}
}
1 change: 1 addition & 0 deletions dgraph/cmd/zero/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
4 changes: 1 addition & 3 deletions x/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ package x

import (
"fmt"
"os"
)

var (
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit e2783d6

Please sign in to comment.