Skip to content

Commit

Permalink
throw error for invalid args
Browse files Browse the repository at this point in the history
  • Loading branch information
arnold-keyvalue committed Aug 22, 2022
1 parent d2a4669 commit fa88d96
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const (
)

func setProject(env string) string {
// TODO: get project list with gcloud sdk
switch env {
case "dev":
project = "beecash-staging"
Expand Down
3 changes: 2 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ var rootCmd = &cobra.Command{
var connectCmd = &cobra.Command{
Use: "connect",
Short: "connect to cloudsql instance",
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
env, _ := cmd.Flags().GetString("env")
port, _ := cmd.Flags().GetInt("port")
Expand All @@ -38,7 +39,7 @@ var connectCmd = &cobra.Command{
var disconnectCmd = &cobra.Command{
Use: "disconnect",
Short: "disconnect cloudsql instance proxy",
// Args: cobra.ExactArgs(2),
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
disconnectInstance()
},
Expand Down

0 comments on commit fa88d96

Please sign in to comment.