add version file and --version arg to CLI

This commit is contained in:
mattes 2014-08-25 16:59:02 +02:00
parent 37422d109d
commit c4c955d345
2 changed files with 9 additions and 0 deletions

View File

@ -18,11 +18,17 @@ import (
var url = flag.String("url", "", "")
var migrationsPath = flag.String("path", "", "")
var version = flag.Bool("version", false, "Show migrate version")
func main() {
flag.Parse()
command := flag.Arg(0)
if *version {
fmt.Printf("%.2f", Version)
os.Exit(0)
}
if *migrationsPath == "" {
*migrationsPath, _ = os.Getwd()
}

3
version.go Normal file
View File

@ -0,0 +1,3 @@
package main
const Version float64 = 1.1