github.com/goonzoid/gcli@v0.2.3-0.20150926213610-155587606ea1/skeleton/resource/tmpl/go_cmd/command.go.tmpl (about) 1 package main 2 3 var cmd{{ title .Name }} = &Command{ 4 Run: run{{ title .Name }}, 5 UsageLine: "{{ .Name }} ", 6 Short: "{{ .Synopsis }}", 7 Long: ` 8 {{ .Help }} 9 `, 10 } 11 12 func init(){ 13 // Set your flag here like below. 14 // cmd{{ title .Name }}.Flag.BoolVar(&flagA, "a", false, "") 15 } 16 17 // run{{ title .Name }} executes {{ .Name }} command and return exit code. 18 func run{{ title .Name }}(args []string) int { 19 {{ if ne .DebugOutput "" }}print("{{ .DebugOutput }}"){{ end }} 20 return 0 21 }