github.com/goonzoid/gcli@v0.2.3-0.20150926213610-155587606ea1/commands.go (about) 1 package main 2 3 import ( 4 "github.com/mitchellh/cli" 5 "github.com/tcnksm/gcli/command" 6 ) 7 8 // Commands are collections of gcli commands. 9 func Commands(meta *command.Meta) map[string]cli.CommandFactory { 10 return map[string]cli.CommandFactory{ 11 "new": func() (cli.Command, error) { 12 return &command.NewCommand{ 13 Meta: *meta, 14 }, nil 15 }, 16 17 "design": func() (cli.Command, error) { 18 return &command.DesignCommand{ 19 Meta: *meta, 20 }, nil 21 }, 22 23 "validate": func() (cli.Command, error) { 24 return &command.ValidateCommand{ 25 Meta: *meta, 26 }, nil 27 }, 28 29 "apply": func() (cli.Command, error) { 30 return &command.ApplyCommand{ 31 Meta: *meta, 32 }, nil 33 }, 34 35 "list": func() (cli.Command, error) { 36 return &command.ListCommand{ 37 Meta: *meta, 38 }, nil 39 }, 40 41 "version": func() (cli.Command, error) { 42 return &command.VersionCommand{ 43 Meta: *meta, 44 Version: Version, 45 Revision: GitCommit, 46 }, nil 47 }, 48 } 49 }