Skip to content

Commit

Permalink
add -version flag and goxc build config
Browse files Browse the repository at this point in the history
  • Loading branch information
willnorris committed Dec 26, 2013
1 parent 405faae commit 26dde07
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
build
.goxc.local.json
*.test
6 changes: 6 additions & 0 deletions .goxc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ConfigVersion": "0.9",
"ArtifactsDest": "build",
"PackageVersion": "0.1",
"PrereleaseInfo": "snapshot"
}
16 changes: 15 additions & 1 deletion imageproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,28 @@ import (
"github.com/willnorris/go-imageproxy/proxy"
)

// goxc values
var (
// VERSION is the version string for go-imageproxy.
VERSION string
// BUILD_DATE is the timestamp of when go-imageproxy was built.
BUILD_DATE string
)

var addr = flag.String("addr", "localhost:8080", "TCP address to listen on")
var whitelist = flag.String("whitelist", "", "comma separated list of allowed remote hosts")
var cacheDir = flag.String("cacheDir", "", "directory to use for file cache")
var version = flag.Bool("version", false, "print version information")

func main() {
flag.Parse()

fmt.Printf("go-imageproxy listening on %s\n", *addr)
if *version {
fmt.Printf("%v\nBuild: %v\n", VERSION, BUILD_DATE)
return
}

fmt.Printf("go-imageproxy (version %v) listening on %s\n", VERSION, *addr)

var c httpcache.Cache
if *cacheDir != "" {
Expand Down

0 comments on commit 26dde07

Please sign in to comment.