File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ // package cli exposes the command-line interface for sqlc. It can be used to
2
+ // run sqlc from Go without the overhead of creating a child process.
3
+ //
4
+ // Example usage:
5
+ //
6
+ // package main
7
+ //
8
+ // import (
9
+ // "os"
10
+ //
11
+ // sqlc "github.com/kyleconroy/sqlc/pkg/cli"
12
+ // )
13
+ //
14
+ // func main() {
15
+ // os.Exit(sqlc.Run(os.Args[1:], os.Stdin, os.Stdout, os.Stderr))
16
+ // }
17
+ //
18
+ package cli
19
+
20
+ import (
21
+ "io"
22
+
23
+ "github.com/kyleconroy/sqlc/internal/cmd"
24
+ )
25
+
26
+ // Run the sqlc CLI. It takes an array of command-line arguments
27
+ // (excluding the executable argument itself) and returns an exit
28
+ // code.
29
+ func Run (args []string , stdin io.Reader , stdout io.Writer , stderr io.Writer ) int {
30
+ return cmd .Do (args , stdin , stdout , stderr )
31
+ }
You can’t perform that action at this time.
0 commit comments