add options , config

This commit is contained in:
root committed 2018-05-08 16:19:51 +08:00
1 parent 80e5f0b19c
commit fe884e6931
10 files changed
+172 -12

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
package options
import (
"flag"
)
// Options -
type Options struct {
Config string
}
var (
opts *Options
)
// RegFlag -
func RegFlag() {
opts = &Options{}
flag.StringVar(&opts.Config, "c", "", "config `file path`")
}
// GetOpts -
func GetOpts() *Options {
return opts
}