26 lines
281 B
Go
26 lines
281 B
Go
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
|
|
}
|