We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a94163b commit c346dddCopy full SHA for c346ddd
pkg/cli/cli.go
@@ -0,0 +1,31 @@
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:]))
16
+// }
17
18
+package cli
19
+
20
+import (
21
+ "os"
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) int {
30
+ return cmd.Do(args, os.Stdin, os.Stdout, os.Stderr)
31
+}
0 commit comments