add version to the binary

Related #95
This commit is contained in:
Gokcehan committed 2018-03-22 20:42:15 +03:00
1 parent 33fb6f0d47
commit 91c3790032
2 files changed
+34 -24

No files matched your search

+8
View File
@@ -24,6 +24,7 @@ var (
gSocketPath string
gLogPath string
gServerLogPath string
gVersion string
)
func init() {
@@ -47,6 +48,11 @@ func main() {
false,
"show documentation")
showVersion := flag.Bool(
"version",
false,
"show version")
remoteCmd := flag.String(
"remote",
"",
@@ -109,6 +115,8 @@ func main() {
switch {
case *showDoc:
fmt.Print(genDocString)
case *showVersion:
fmt.Println(gVersion)
case *remoteCmd != "":
if err := sendRemote(*remoteCmd); err != nil {
log.Fatalf("remote command: %s", err)