forked from hashicorp/consul-replicate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
35 lines (28 loc) · 805 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package main // import "github.com/hashicorp/consul-replicate"
import (
"bytes"
"fmt"
"os"
)
// The git commit that was compiled. This will be filled in by the compiler.
var GitCommit string
const Name = "consul-replicate"
const Version = "0.2.1"
const VersionPrerelease = "dev"
func main() {
cli := NewCLI(os.Stdout, os.Stderr)
os.Exit(cli.Run(os.Args))
}
// formattedVersion returns a formatted version string which includes the git
// commit and development information.
func formattedVersion() string {
var versionString bytes.Buffer
fmt.Fprintf(&versionString, "%s v%s", Name, Version)
if VersionPrerelease != "" {
fmt.Fprintf(&versionString, "-%s", VersionPrerelease)
if GitCommit != "" {
fmt.Fprintf(&versionString, " (%s)", GitCommit)
}
}
return versionString.String()
}