Skip to content

Commit

Permalink
Display version information if the version flag is given
Browse files Browse the repository at this point in the history
  • Loading branch information
olabiniV2 committed Apr 29, 2020
1 parent e26479a commit 570d7a2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/command_line.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ var (
Trace = flag.Bool("trace", false, "start Wahay in tracing mode")
// DebugFunctionCalls contains the command line argument given for debugging
DebugFunctionCalls = flag.Bool("debug-function-calls", false, "trace function calls in logging")
// Version contains the command line argument given for version
Version = flag.Bool("version", false, "display version information and exit")
)

// ProcessCommandLineArguments will parse the command line, check that
Expand Down
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package main

import (
"fmt"

"github.com/coyim/gotk3adapter/gdka"
"github.com/coyim/gotk3adapter/gliba"
"github.com/coyim/gotk3adapter/gtka"
Expand Down Expand Up @@ -35,6 +37,11 @@ func initializeLogging() {
func main() {
config.ProcessCommandLineArguments()

if *config.Version {
fmt.Printf("Wahay (commit: %s (%s) tag: %s built: %s)\n", BuildShortCommit, BuildCommit, BuildTag, BuildTimestamp)
return
}

initializeLogging()

runClient()
Expand Down

0 comments on commit 570d7a2

Please sign in to comment.