diff --git a/cmd/connect.go b/cmd/connect.go index 9a129f2..6a4988e 100644 --- a/cmd/connect.go +++ b/cmd/connect.go @@ -24,6 +24,7 @@ const ( ) func setProject(env string) string { + // TODO: get project list with gcloud sdk switch env { case "dev": project = "beecash-staging" diff --git a/cmd/root.go b/cmd/root.go index 0e02261..c3b5fe7 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -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") @@ -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() },