add flag options, add schema submodule

This commit is contained in:
Jay
2018-09-19 20:23:39 +08:00
parent e86171151a
commit a43bf98e21
7 changed files with 71 additions and 2 deletions
+28
View File
@@ -0,0 +1,28 @@
package options
import (
"flag"
)
// Options - flag options
type Options struct {
Help bool
Config string
DBTool bool
}
var opts *Options
// RegFlag - register flag
func RegFlag() {
opts = &Options{}
flag.StringVar(&opts.Config, "config", "", "config file path (defualt {PWD}/config.yml")
flag.StringVar(&opts.Config, "f", "", "config file path (short) (defualt {PWD}/config.yml")
flag.BoolVar(&opts.DBTool, "dbtool", false, "run dbtool deploy schema")
flag.BoolVar(&opts.Help, "help", false, "show help")
}
// GetFlag -
func GetFlag() *Options {
return opts
}