Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: hanging unknown commands #1930

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions cmd/aws/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"fmt"

"github.com/kubefirst/kubefirst/internal/common"
"github.com/kubefirst/kubefirst/internal/progress"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -47,6 +48,14 @@ func NewCommand() *cobra.Command {
Use: "aws",
Short: "kubefirst aws installation",
Long: "kubefirst aws",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("To learn more about aws in kubefirst, run:")
fmt.Println(" kubefirst help")

if progress.Progress != nil {
progress.Progress.Quit()
}
},
}

// wire up new commands
Expand Down
5 changes: 5 additions & 0 deletions cmd/beta.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/kubefirst/kubefirst/cmd/digitalocean"
"github.com/kubefirst/kubefirst/cmd/google"
"github.com/kubefirst/kubefirst/cmd/vultr"
"github.com/kubefirst/kubefirst/internal/progress"
"github.com/spf13/cobra"
)

Expand All @@ -23,6 +24,10 @@ var betaCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("To learn more about kubefirst, run:")
fmt.Println(" kubefirst help")

if progress.Progress != nil {
progress.Progress.Quit()
}
},
}

Expand Down
9 changes: 9 additions & 0 deletions cmd/civo/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"fmt"

"github.com/kubefirst/kubefirst/internal/common"
"github.com/kubefirst/kubefirst/internal/progress"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -47,6 +48,14 @@ func NewCommand() *cobra.Command {
Use: "civo",
Short: "kubefirst civo installation",
Long: "kubefirst civo",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("To learn more about civo in kubefirst, run:")
fmt.Println(" kubefirst civo --help")

if progress.Progress != nil {
progress.Progress.Quit()
}
},
}

// wire up new commands
Expand Down
9 changes: 9 additions & 0 deletions cmd/digitalocean/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"fmt"

"github.com/kubefirst/kubefirst/internal/common"
"github.com/kubefirst/kubefirst/internal/progress"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -47,6 +48,14 @@ func NewCommand() *cobra.Command {
Use: "digitalocean",
Short: "kubefirst DigitalOcean installation",
Long: "kubefirst digitalocean",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("To learn more about digital ocean in kubefirst, run:")
fmt.Println(" kubefirst beta digitalocean --help")

if progress.Progress != nil {
progress.Progress.Quit()
}
},
}

// on error, doesnt show helper/usage
Expand Down
9 changes: 9 additions & 0 deletions cmd/google/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"fmt"

"github.com/kubefirst/kubefirst/internal/common"
"github.com/kubefirst/kubefirst/internal/progress"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -50,6 +51,14 @@ func NewCommand() *cobra.Command {
Use: "google",
Short: "kubefirst Google installation",
Long: "kubefirst google",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("To learn more about google in kubefirst, run:")
fmt.Println(" kubefirst beta google --help")

if progress.Progress != nil {
progress.Progress.Quit()
}
},
}

// on error, doesnt show helper/usage
Expand Down
9 changes: 9 additions & 0 deletions cmd/k3d/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package k3d
import (
"fmt"

"github.com/kubefirst/kubefirst/internal/progress"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -46,6 +47,14 @@ func NewCommand() *cobra.Command {
Use: "k3d",
Short: "kubefirst k3d installation",
Long: "kubefirst k3d",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("To learn more about k3d in kubefirst, run:")
fmt.Println(" kubefirst k3d --help")

if progress.Progress != nil {
progress.Progress.Quit()
}
},
}

// wire up new commands
Expand Down
2 changes: 2 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/kubefirst/kubefirst/cmd/civo"
"github.com/kubefirst/kubefirst/cmd/k3d"
"github.com/kubefirst/kubefirst/internal/common"
"github.com/kubefirst/kubefirst/internal/progress"
"github.com/kubefirst/runtime/configs"

"github.com/kubefirst/runtime/pkg/progressPrinter"
Expand All @@ -34,6 +35,7 @@ var rootCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("To learn more about kubefirst, run:")
fmt.Println(" kubefirst help")
progress.Progress.Quit()
},
}

Expand Down
9 changes: 9 additions & 0 deletions cmd/vultr/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"fmt"

"github.com/kubefirst/kubefirst/internal/common"
"github.com/kubefirst/kubefirst/internal/progress"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -48,6 +49,14 @@ func NewCommand() *cobra.Command {
Use: "vultr",
Short: "kubefirst Vultr installation",
Long: "kubefirst vultr",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("To learn more about vultr in kubefirst, run:")
fmt.Println(" kubefirst beta vultr --help")

if progress.Progress != nil {
progress.Progress.Quit()
}
},
}

// on error, doesnt show helper/usage
Expand Down