Skip to content

Commit

Permalink
Merge pull request #334 from teharrison/master
Browse files Browse the repository at this point in the history
add version option
  • Loading branch information
teharrison authored Jul 24, 2017
2 parents c8e0a02 + b47a002 commit f7c9f99
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions shock-server/conf/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ type idxOpts struct {
sparse bool
}

const VERSION string = "[% VERSION %]"

var LOG_OUTPUTS = [3]string{"file", "console", "both"}

var (
Expand Down Expand Up @@ -146,6 +148,10 @@ func Initialize() (err error) {
c_store.PrintHelp()
os.Exit(0)
}
if SHOW_VERSION {
fmt.Printf("Shock version: %s\n", VERSION)
os.Exit(0)
}

return
}
Expand Down
2 changes: 1 addition & 1 deletion shock-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func mapRoutes() {
S: time.Now().Format(longDateForm),
T: "Shock",
U: host + "/",
V: "[% VERSION %]",
V: conf.VERSION,
}
return responder.WriteResponseObject(ctx, http.StatusOK, r)
})
Expand Down

0 comments on commit f7c9f99

Please sign in to comment.