Skip to content

Commit

Permalink
🔥 Attempt to determine dialect even when pod flag is set
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Apr 20, 2022
1 parent c3307fc commit 0f745b2
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cmd

import (
"errors"
"fmt"
"github.com/clevyr/kubedb/cmd/dump"
"github.com/clevyr/kubedb/cmd/exec"
Expand Down Expand Up @@ -62,26 +61,6 @@ func preRun(cmd *cobra.Command, args []string) error {
}
}

dialectFlag, err := cmd.Flags().GetString("dialect")
if err != nil {
panic(err)
}
if dialectFlag == "" {
dialectFlag, err = cmd.Flags().GetString("grammar")
if err != nil {
panic(err)
}
}

podFlag, err := cmd.Flags().GetString("pod")
if err != nil {
panic(err)
}

if podFlag != "" && dialectFlag == "" {
return errors.New("pod flag is set, but dialect is missing. please add --dialect")
}

return nil
}

Expand Down

0 comments on commit 0f745b2

Please sign in to comment.