Skip to content

Commit 921e84f

Browse files
authored
cmd: Remove parse subcommand (#322)
1 parent 8601eec commit 921e84f

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

internal/cmd/cmd.go

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import (
99
"os/exec"
1010
"path/filepath"
1111

12-
"github.com/davecgh/go-spew/spew"
13-
pg "github.com/lfittl/pg_query_go"
1412
"github.com/spf13/cobra"
1513

1614
"github.com/kyleconroy/sqlc/internal/config"
@@ -23,7 +21,6 @@ func Do(args []string, stdin io.Reader, stdout io.Writer, stderr io.Writer) int
2321
rootCmd.AddCommand(checkCmd)
2422
rootCmd.AddCommand(genCmd)
2523
rootCmd.AddCommand(initCmd)
26-
rootCmd.AddCommand(parseCmd)
2724
rootCmd.AddCommand(versionCmd)
2825

2926
rootCmd.SetArgs(args)
@@ -49,25 +46,6 @@ var versionCmd = &cobra.Command{
4946
},
5047
}
5148

52-
var parseCmd = &cobra.Command{
53-
Use: "parse",
54-
Short: "Parse and print the AST for a SQL file",
55-
RunE: func(cmd *cobra.Command, args []string) error {
56-
for _, filename := range args {
57-
blob, err := ioutil.ReadFile(filename)
58-
if err != nil {
59-
return err
60-
}
61-
tree, err := pg.Parse(string(blob))
62-
if err != nil {
63-
return err
64-
}
65-
spew.Dump(tree)
66-
}
67-
return nil
68-
},
69-
}
70-
7149
var initCmd = &cobra.Command{
7250
Use: "init",
7351
Short: "Create an empty sqlc.json settings file",

0 commit comments

Comments
 (0)