Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
12 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,8 @@ | ||
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" | ||
import "os" | ||
|
||
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() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package main | ||
|
||
import "fmt" | ||
|
||
var ( | ||
Name string | ||
Version string | ||
GitCommit string | ||
|
||
humanVersion = fmt.Sprintf("%s v%s (%s)", Name, Version, GitCommit) | ||
) |