Skip to content

Commit

Permalink
making commands private (#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
kensipe committed Jun 7, 2019
1 parent 173dac4 commit dac8911
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 14 deletions.
1 change: 1 addition & 0 deletions go.sum
Expand Up @@ -81,6 +81,7 @@ github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASu
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf h1:+RRA9JqSOZFfKrOeqr2z77+8R2RKyh8PG66dcu1V0ck=
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/uuid v1.1.0 h1:Jf4mxPC/ziBnoPIdpQdPJ9OeiomAUHLvxmPRSPH9m4s=
github.com/google/uuid v1.1.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
Expand Down
4 changes: 2 additions & 2 deletions pkg/kudoctl/cmd/get.go
Expand Up @@ -5,8 +5,8 @@ import (
"github.com/spf13/cobra"
)

// NewGetCmd creates a new command that lists instances
func NewGetCmd() *cobra.Command {
// newGetCmd creates a new command that lists instances
func newGetCmd() *cobra.Command {
newCmd := &cobra.Command{
Use: "get",
Short: "-> Show all available instances.",
Expand Down
4 changes: 2 additions & 2 deletions pkg/kudoctl/cmd/install.go
Expand Up @@ -20,8 +20,8 @@ var (
kubectl kudo install kafka --package-version=0`
)

// NewInstallCmd creates the install command for the CLI
func NewInstallCmd() *cobra.Command {
// newInstallCmd creates the install command for the CLI
func newInstallCmd() *cobra.Command {
installCmd := &cobra.Command{
Use: "install <name>",
Short: "-> Install an official KUDO package.",
Expand Down
4 changes: 2 additions & 2 deletions pkg/kudoctl/cmd/install_test.go
Expand Up @@ -9,7 +9,7 @@ import (

func TestNewCmdInstallReturnsCmd(t *testing.T) {

newCmdInstall := NewInstallCmd()
newCmdInstall := newInstallCmd()

if newCmdInstall.Parent() != nil {
t.Fatal("We expect the newCmdInstall command to be returned")
Expand Down Expand Up @@ -38,7 +38,7 @@ var parameterTests = []struct {

func TestTableNewInstallCmd_WithParameters(t *testing.T) {
for _, test := range parameterTests {
newCmdInstall := NewInstallCmd()
newCmdInstall := newInstallCmd()
for _, flag := range test.flags {
newCmdInstall.Flags().Set("parameter", flag)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/kudoctl/cmd/plan.go
Expand Up @@ -5,8 +5,8 @@ import (
"github.com/spf13/cobra"
)

// NewPlanCmd creates a new command that shows the plans available for an instance
func NewPlanCmd() *cobra.Command {
// newPlanCmd creates a new command that shows the plans available for an instance
func newPlanCmd() *cobra.Command {
newCmd := &cobra.Command{
Use: "plan",
Short: "-> View all available plans.",
Expand Down
8 changes: 4 additions & 4 deletions pkg/kudoctl/cmd/root.go
Expand Up @@ -38,10 +38,10 @@ and serves as an API aggregation layer.
Version: version.Get().GitVersion,
}

cmd.AddCommand(NewInstallCmd())
cmd.AddCommand(NewGetCmd())
cmd.AddCommand(NewPlanCmd())
cmd.AddCommand(NewVersionCmd())
cmd.AddCommand(newInstallCmd())
cmd.AddCommand(newGetCmd())
cmd.AddCommand(newPlanCmd())
cmd.AddCommand(newVersionCmd())

return cmd
}
4 changes: 2 additions & 2 deletions pkg/kudoctl/cmd/version.go
Expand Up @@ -14,8 +14,8 @@ var (
kubectl kudo version`
)

// NewVersionCmd returns a new initialized instance of the version sub command
func NewVersionCmd() *cobra.Command {
// newVersionCmd returns a new initialized instance of the version sub command
func newVersionCmd() *cobra.Command {
versionCmd := &cobra.Command{
Use: "version",
Short: "-> Print the current KUDO package version.",
Expand Down

0 comments on commit dac8911

Please sign in to comment.