示例#1
0
文件: main.go 项目: jcw/flow
func main() {
	flag.Parse()

	err := flow.AddToRegistry(*setupFile)
	if err != nil && !*verbose {
		glog.Fatal(err)
	}

	if *verbose {
		fmt.Println("Flow", flow.Version, "\n")
		flow.PrintRegistry()
		fmt.Println("\nDocumentation at http://godoc.org/github.com/jcw/flow")
	} else {
		glog.Infof("Flow %s - starting, registry size %d",
			flow.Version, len(flow.Registry))
		if factory, ok := flow.Registry[*appMain]; ok {
			factory().Run()
		} else {
			glog.Fatalln(*appMain, "not found in:", *setupFile)
		}
		glog.Infof("Flow %s -, normal exit", flow.Version)
	}
}
示例#2
0
文件: all.go 项目: x4rMa/jeebus
func (g *infoCmd) Run() {
	fmt.Println("Registered gadgets and circuits:\n")
	flow.PrintRegistry()
	fmt.Println()
}