Skip to content
Snippets Groups Projects
Verified Commit 37d7978e authored by Philipp Winter's avatar Philipp Winter
Browse files

Introduce semantic versioning.

...and start with version 0.0.1.
parent 1acc2710
No related branches found
Tags 1.9.8
No related merge requests found
......@@ -16,6 +16,12 @@ import (
"github.com/gorilla/mux"
)
const (
// BridgestrapVersion specifies bridgestrap's version. The version number
// is based on semantic versioning: https://semver.org
BridgestrapVersion = "0.0.1"
)
type Route struct {
Name string
Method string
......@@ -109,7 +115,7 @@ func main() {
var err error
var addr string
var web, printCache, unsafeLogging bool
var web, printCache, unsafeLogging, showVersion bool
var certFilename, keyFilename string
var cacheFile string
var templatesDir string
......@@ -119,6 +125,7 @@ func main() {
flag.BoolVar(&web, "web", false, "Enable the web interface (in addition to the JSON API).")
flag.BoolVar(&printCache, "print-cache", false, "Print the given cache file and exit.")
flag.BoolVar(&unsafeLogging, "unsafe", false, "Don't scrub IP addresses in log messages.")
flag.BoolVar(&showVersion, "version", false, "Print bridgestrap's version and exit.")
flag.StringVar(&certFilename, "cert", "", "TLS certificate file.")
flag.StringVar(&keyFilename, "key", "", "TLS private key file.")
flag.StringVar(&cacheFile, "cache", "bridgestrap-cache.bin", "Cache file that contains test results.")
......@@ -126,6 +133,11 @@ func main() {
flag.IntVar(&numSecs, "seconds", 0, "Number of seconds after two subsequent requests are handled.")
flag.Parse()
if showVersion {
fmt.Printf("bridgestrap version %s\n", BridgestrapVersion)
return
}
var logOutput io.Writer = os.Stderr
// Send the log output through our scrubber first.
if !printCache && !unsafeLogging {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment