in cmd/gendocs/gen_cloud-sql-proxy_docs.go [26:51]
func main() {
if len(os.Args) > 2 {
fmt.Fprintf(os.Stderr, "usage: %s [output directory]\n", os.Args[0])
os.Exit(1)
}
path := "docs/cmd"
if len(os.Args) == 2 {
path = os.Args[1]
}
outDir, err := filepath.Abs(path)
if err != nil {
fmt.Fprintf(os.Stderr, "failed to get output directory: %v\n", err)
os.Exit(1)
}
// Set environment variables used so the output is consistent,
// regardless of where we run.
os.Setenv("TMPDIR", "/tmp")
cloudSQLProxy := cmd.NewCommand()
cloudSQLProxy.Execute()
cloudSQLProxy.Command.DisableAutoGenTag = true
doc.GenMarkdownTree(cloudSQLProxy.Command, outDir)
}