Rename base.New -> base.NewCommand for clarity

This commit is contained in:
Jeff Mitchell committed 2020-06-24 15:10:12 -05:00
1 parent 8afcbd4c8e
commit 16b56a37ed
3 files changed
+8 -8

No files matched your search

+1 -1
View File
@@ -59,7 +59,7 @@ type Command struct {
}
// New returns a new instance of a base.Command type
func New(ui cli.Ui) *Command {
func NewCommand(ui cli.Ui) *Command {
ctx, cancel := context.WithCancel(context.Background())
ret := &Command{
UI: ui,
+6 -6
View File
@@ -53,33 +53,33 @@ func initCommands(ui, serverCmdUi cli.Ui, runOpts *RunOptions) {
},
"hosts create": func() (cli.Command, error) {
return &hosts.CreateCommand{
Command: base.New(ui),
Command: base.NewCommand(ui),
}, nil
},
"projects create": func() (cli.Command, error) {
return &scopes.CreateProjectCommand{
Command: base.New(ui),
Command: base.NewCommand(ui),
}, nil
},
"projects read": func() (cli.Command, error) {
return &scopes.ReadProjectCommand{
Command: base.New(ui),
Command: base.NewCommand(ui),
}, nil
},
"config": func() (cli.Command, error) {
return &config.Command{
Command: base.New(ui),
Command: base.NewCommand(ui),
}, nil
},
"config encrypt": func() (cli.Command, error) {
return &config.EncryptDecryptCommand{
Command: base.New(ui),
Command: base.NewCommand(ui),
Encrypt: true,
}, nil
},
"config decrypt": func() (cli.Command, error) {
return &config.EncryptDecryptCommand{
Command: base.New(ui),
Command: base.NewCommand(ui),
}, nil
},
}
@@ -50,7 +50,7 @@ func TestEncryptDecrypt(t *testing.T) {
}
cmd := &EncryptDecryptCommand{
Command: base.New(ui),
Command: base.NewCommand(ui),
Encrypt: c.encrypt}
if err := cmd.Run([]string{c.config}); err != 0 {