Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new version checker #232

Merged
merged 1 commit into from
Aug 18, 2015
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
6 changes: 4 additions & 2 deletions registrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@ package main
import (
"errors"
"flag"
"fmt"
"log"
"os"
"time"

dockerapi "github.com/fsouza/go-dockerclient"
"github.com/gliderlabs/pkg/usage"
"github.com/gliderlabs/registrator/bridge"
)

var Version string

var versionChecker = usage.NewChecker("registrator", Version)

var hostIp = flag.String("ip", "", "IP for ports mapped to the host")
var internal = flag.Bool("internal", false, "Use internal ports instead of published ones")
var refreshInterval = flag.Int("ttl-refresh", 0, "Frequency with which service TTLs are refreshed")
Expand All @@ -37,7 +39,7 @@ func assert(err error) {

func main() {
if len(os.Args) == 2 && os.Args[1] == "--version" {
fmt.Println(Version)
versionChecker.PrintVersion()
os.Exit(0)
}
log.Printf("Starting registrator %s ...", Version)
Expand Down