Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
main: Add a CLI version option
Browse files Browse the repository at this point in the history
Add a `--version` command-line option to allow the agent version to be
queried.

Fixes #212.

Signed-off-by: James O. D. Hunt <[email protected]>
  • Loading branch information
jodh-intel committed Mar 7, 2018
1 parent 6f6e9ec commit 14c4a2d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ func init() {
var Version = "unknown"

func main() {
if len(os.Args) == 2 && os.Args[1] == "--version" {
fmt.Printf("%s version %s\n", name, Version)
os.Exit(0)
}

agentLog.Logger.Formatter = &logrus.JSONFormatter{TimestampFormat: time.RFC3339Nano}
config := newConfig(defaultLogLevel)
Expand Down

0 comments on commit 14c4a2d

Please sign in to comment.