Skip to content

Commit

Permalink
port to example
Browse files Browse the repository at this point in the history
  • Loading branch information
1vn committed Nov 13, 2018
1 parent 1719136 commit 428691c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions examples/go-migrations/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,21 @@ func main() {
flags.Parse(os.Args[1:])

args := flags.Args()
if len(args) == 0 || args[0] == "-h" || args[0] == "--help" {
flags.Usage()
return
}

if len(args) > 1 && args[0] == "create" {
switch args[0] {
case "create":
if err := goose.Run("create", nil, *dir, args[1:]...); err != nil {
log.Fatalf("goose run: %v", err)
}
return
}

// TODO clean up arg/flag parsing flow
if args[0] == "fix" {
case "fix":
if err := goose.Run("fix", nil, *dir); err != nil {
log.Fatalf("goose run: %v", err)
}
return
}

if len(args) < 3 {
Expand Down

0 comments on commit 428691c

Please sign in to comment.