Exemplo n.º 1
0
func standalone() {
	command.On("cmd", "run a command", &RunCommand{}, []string{})
	command.On("file", "copy a file", &FileCommand{}, []string{})
	command.On("dir", "copy a dir", &DirCommand{}, []string{})
	command.Parse()
	command.Run()
}
Exemplo n.º 2
0
func main() {
	// Registers authCmd to handle `program [args...] auth [subcommand-args...]`
	command.On("auth", "Allow you to authorize and configure project settings.", &authCmd{}, []string{"project"})
	// Registers startCmd to handle `program [args...] start [subcommand-args...]`
	command.On("start", "Starts the proxy server.", &startCmd{}, []string{})
	command.ParseAndRun()
}
Exemplo n.º 3
0
func main() {
	command.On("init", descInit, &initCmd{}, []string{})
	command.On("pull", descPull, &pullCmd{}, []string{})
	command.On("push", descPush, &pushCmd{}, []string{})
	command.On("diff", descDiff, &diffCmd{}, []string{})
	command.On("pub", descPublish, &publishCmd{}, []string{})
	command.ParseAndRun()
}