forked from sqlc-dev/sqlc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.go
More file actions
30 lines (27 loc) · 631 Bytes
/
cli.go
File metadata and controls
30 lines (27 loc) · 631 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// package cli exposes the command-line interface for sqlc. It can be used to
// run sqlc from Go without the overhead of creating a child process.
//
// Example usage:
//
// package main
//
// import (
// "os"
//
// sqlc "github.com/sqlc-dev/sqlc/pkg/cli"
// )
//
// func main() {
// os.Exit(sqlc.Run(os.Args[1:]))
// }
package cli
import (
"os"
"github.com/sqlc-dev/sqlc/internal/cmd"
)
// Run the sqlc CLI. It takes an array of command-line arguments
// (excluding the executable argument itself) and returns an exit
// code.
func Run(args []string) int {
return cmd.Do(args, os.Stdin, os.Stdout, os.Stderr)
}