Example #1
0
File: main.go Project: yubo/falcon
func main() {
	flags.Parse()
	cmd := flags.CommandLine.Cmd

	if cmd != nil && cmd.Action != nil {
		opts.Args = cmd.Flag.Args()
		cmd.Action(&opts)
	} else {
		start(&opts)
	}
}
Example #2
0
File: tty.go Project: yubo/gotty
func Parse() {
	flags.Parse() //for glog

	_, err := os.Stat(expandHomeDir(configFile))
	if !os.IsNotExist(err) {
		if err := applyConfigFile(&GlobalOpt, configFile); err != nil {
			glog.Errorln(err)
			os.Exit(2)
		}
	}

}