Add some more information to -version flag

This commit is contained in:
Zachary Yedidia
2016-08-27 20:03:43 -04:00
parent 2de42bcf99
commit 1260dcc5ee
3 changed files with 16 additions and 8 deletions

View File

@@ -43,7 +43,9 @@ var (
// Version is the version number or commit hash
// This should be set by the linker when compiling
Version = "Unknown"
Version = "Unknown"
CommitHash = "Unknown"
CompileDate = "Unknown"
// L is the lua state
// This is the VM that runs the plugins
@@ -194,7 +196,9 @@ func main() {
flag.Parse()
if *flagVersion {
// If -version was passed
fmt.Println("Micro version:", Version)
fmt.Println("Version:", Version)
fmt.Println("Commit hash:", CommitHash)
fmt.Println("Compiled on", CompileDate)
os.Exit(0)
}