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

     1  package main
     2  
     3  import (
     4  	"github.com/mitchellh/cli"
     5  	"github.com/{{ .Owner }}/{{ .Name }}/command"
     6  )
     7  
     8  func Commands(meta *command.Meta) map[string]cli.CommandFactory {
     9  	return map[string]cli.CommandFactory{
    10  		{{ range .Commands }}"{{ .Name }}": func() (cli.Command, error) {
    11  			return &command.{{ title .FunctionName }}Command{
    12  				Meta: *meta,
    13  			}, nil
    14  		},
    15  		{{ end }}
    16          "version": func() (cli.Command, error) {
    17  			return &command.VersionCommand{
    18  				Meta:     *meta,
    19  				Version:  Version,
    20                  Revision: GitCommit,
    21                  Name: Name,
    22  			}, nil
    23  		},
    24  	}
    25  }