github.com/jduhamel/gcli@v0.2.4-0.20151019142748-0d5307cd7e21/skeleton/resource/tmpl/mitchellh_cli/command/command.go.tmpl (about)

     1  package command
     2  
     3  import (
     4      "strings"
     5  )
     6  
     7  type {{ title .FunctionName }}Command struct {
     8  	Meta
     9  }
    10  
    11  func (c *{{ title .FunctionName }}Command) Run(args []string) int {
    12      // Write your code here
    13      {{ if ne .DebugOutput "" }}print("{{ .DebugOutput }}"){{ end }}
    14  	return 0
    15  }
    16  
    17  func (c *{{ title .FunctionName }}Command) Synopsis() string {
    18  	return "{{ .Synopsis }}"
    19  }
    20  
    21  func (c *{{ title .FunctionName }}Command) Help() string {
    22  	helpText := `
    23  {{ .Help }}
    24  `
    25  	return strings.TrimSpace(helpText)
    26  }