diff --git a/main.go b/main.go index 5222c8eb..5cafe31e 100644 --- a/main.go +++ b/main.go @@ -1,13 +1,23 @@ package main import ( - "os" - + "flag" + "fmt" "github.com/Sirupsen/logrus" "github.com/rancher/agent/events" + "os" ) +var VERSION = "dev" + func main() { + version := flag.Bool("version", false, "go-agent version") + flag.Parse() + if *version { + fmt.Printf("go-agent version %s \n", VERSION) + os.Exit(0) + } + logrus.Info("Launching agent") url := os.Getenv("CATTLE_URL")