Skip to content

Commit

Permalink
Add version flag
Browse files Browse the repository at this point in the history
fixup version flag
  • Loading branch information
xwjdsh committed Apr 12, 2018
1 parent b64bd04 commit a87ea0a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion main.go
Expand Up @@ -2,16 +2,25 @@ package main

import (
"flag"
"fmt"

"github.com/gin-gonic/gin"
"github.com/go-ignite/ignite/controllers"
"github.com/go-ignite/ignite/utils"
)

var confPath = flag.String("c", "./conf/config.toml", "config file")
var (
confPath = flag.String("c", "./conf/config.toml", "config file")
versionFlag = flag.Bool("v", false, "version")
version = "unknown"
)

func main() {
flag.Parse()
if *versionFlag {
fmt.Println(version)
return
}
utils.InitConf(*confPath)
initRouter()
}
Expand Down

0 comments on commit a87ea0a

Please sign in to comment.