// ParseOptionsFlag read options from command line flag
ParseOptionsFlag read options from command line flag
// ParseOptionsFlag read options from command line flag
func ParseOptionsFlag(opt *Options) (err error) {
	var (
		file    string
		verbose bool
		dev     bool
	)
	flag.StringVar(&file, "c", "/etc/xlog.yml", "options file")
	flag.BoolVar(&verbose, "verbose", false, "verbose mode, overriding config file")
	flag.BoolVar(&dev, "dev", false, "dev mode, overrding config file")
	flag.Parse()
	if err = ReadOptionsFile(file, opt); err != nil {
		return
	}
	if verbose {
		opt.Verbose = true
	}
	if dev {
		opt.Dev = true
	}
	return
}
func ParseOptionsFlag ( opt * Options ) ( err error ) { var ( file string verbose bool dev bool ) flag . StringVar ( & file , " " , " " , " " ) flag . BoolVar ( & verbose , " " , false , " " ) flag . BoolVar ( & dev , " " , false , " " ) flag . Parse ( ) if err = ReadOptionsFile ( file , opt ) ; err != nil { return } if verbose { opt . Verbose = true } if dev { opt . Dev = true } return }
ParseOptionsFlag read options from command line flag
ParseOptionsFlag read options from command line flag
// read options file // override values