Skip to content

Commit

Permalink
Rename get command to resource type
Browse files Browse the repository at this point in the history
  • Loading branch information
minamijoyo committed Jan 23, 2018
1 parent d2f3b2a commit d4ad793
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions command/get.go → command/resource_type.go
Expand Up @@ -7,13 +7,13 @@ import (
"github.com/minamijoyo/tfschema/tfschema"
)

type GetCommand struct {
type ResourceTypeCommand struct {
Meta
}

func (c *GetCommand) Run(args []string) int {
func (c *ResourceTypeCommand) Run(args []string) int {
if len(args) != 1 {
c.Ui.Error("The get command expects RESOURCE_TYPE.")
c.Ui.Error("The resource type command expects NAME")
c.Ui.Error(c.Help())
return 1
}
Expand Down Expand Up @@ -50,13 +50,13 @@ func detectProviderName(resourceType string) (string, error) {
return s[0], nil
}

func (c *GetCommand) Help() string {
func (c *ResourceTypeCommand) Help() string {
helpText := `
Usage: tfschema get RESOURCE_TYPE
Usage: tfschema resource type NAME
`
return strings.TrimSpace(helpText)
}

func (c *GetCommand) Synopsis() string {
return "get schema for a resource type"
func (c *ResourceTypeCommand) Synopsis() string {
return "Get schema for a resource type"
}
4 changes: 2 additions & 2 deletions main.go
Expand Up @@ -118,8 +118,8 @@ func initCommands() map[string]cli.CommandFactory {
}

commands := map[string]cli.CommandFactory{
"get": func() (cli.Command, error) {
return &command.GetCommand{
"resource type": func() (cli.Command, error) {
return &command.ResourceTypeCommand{
Meta: meta,
}, nil
},
Expand Down

0 comments on commit d4ad793

Please sign in to comment.