예제 #1
0
func main() {
	fh := gofh.Init()
	fh.HandleCommand("init", initProject)
	fh.HandleCommand("deploy", deployProject)
	fh.SetDefaultHandler(showUsage)
	fh.Parse(os.Args[1:])
}
예제 #2
0
파일: main.go 프로젝트: romanoff/ahc
// Ahc command line tool
func main() {
	flagHandler := gofh.Init()
	serverOptions := []*gofh.Option{
		&gofh.Option{Name: "port", Boolean: false},
		&gofh.Option{Name: "dev", Boolean: true},
	}
	flagHandler.HandleCommandWithOptions("server", serverOptions, StartServer)
	flagHandler.HandleCommand("test", TestComponents)
	flagHandler.Parse(os.Args[1:])
}
예제 #3
0
파일: main.go 프로젝트: romanoff/dk
func main() {
	config, _ = ReadConfig(".")
	fh := gofh.Init()
	fh.HandleCommand("init :source", CreateConfig)
	fh.HandleCommand("create :name", CreateDump)
	fh.HandleCommand("apply :name", ApplyDump)
	fh.HandleCommand("rm :name", RemoveDump)
	fh.HandleCommand("list", ListDumps)
	fh.HandleCommand("list :remote", ListRemoteDumps)
	fh.HandleCommand("push :remote :name", PushDump)
	fh.HandleCommand("pull :remote :name", PullDump)
	fh.HandleCommand("rm :remote :name", RemoveRemoteDump)
	fh.SetDefaultHandler(ShowUsage)
	fh.Parse(os.Args[1:])
}