This commit is contained in:
root committed 2019-05-08 18:01:06 +08:00
1 parent fe4bda3d57
commit f828db0a38
6 files changed
+72 -3

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
package option
import "flag"
// Options -
type Options struct {
Help bool
Config string
}
var opts *Options
// RegOptions -
func RegOptions() {
opts = &Options{}
flag.StringVar(&opts.Config, "config", "", "config file path - default: `pwd/config.yml`")
flag.StringVar(&opts.Config, "f", "", "config file path - default: `pwd/config.yml`")
flag.BoolVar(&opts.Help, "help", false, "show help")
flag.Parse()
}
// GetOptions -
func GetOptions() *Options { return opts }