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

main: Add a CLI version option #213

Merged
merged 1 commit into from
Mar 8, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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