new project

This commit is contained in:
Jay
2018-12-24 14:34:13 +08:00
commit 9d9fe262f4
544 changed files with 303269 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
package options
import "flag"
// Options -
type Options struct {
Config string
DBTool bool
}
var opts *Options
// RegFlag -
func RegFlag() {
opts = &Options{}
flag.StringVar(&opts.Config, "config", "", "config file path (default {PWD}/config.yml)")
flag.StringVar(&opts.Config, "f", "", "config file path (short) (default {PWD}/config.yml")
flag.BoolVar(&opts.DBTool, "dbtool", false, "run deploy database script")
flag.Parse()
}
// GetOpts -
func GetOpts() *Options {
return opts
}