MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/cloud-sql-proxy / main

Function main

cmd/gendocs/gen_cloud-sql-proxy_docs.go:26–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24)
25
26func main() {
27 if len(os.Args) > 2 {
28 fmt.Fprintf(os.Stderr, "usage: %s [output directory]\n", os.Args[0])
29 os.Exit(1)
30 }
31
32 path := "docs/cmd"
33 if len(os.Args) == 2 {
34 path = os.Args[1]
35 }
36
37 outDir, err := filepath.Abs(path)
38 if err != nil {
39 fmt.Fprintf(os.Stderr, "failed to get output directory: %v\n", err)
40 os.Exit(1)
41 }
42
43 // Set environment variables used so the output is consistent,
44 // regardless of where we run.
45 os.Setenv("TMPDIR", "/tmp")
46
47 cloudSQLProxy := cmd.NewCommand()
48 cloudSQLProxy.Execute()
49 cloudSQLProxy.DisableAutoGenTag = true
50 doc.GenMarkdownTree(cloudSQLProxy.Command, outDir)
51}

Callers

nothing calls this directly

Calls 2

NewCommandFunction · 0.92
ExecuteMethod · 0.80

Tested by

no test coverage detected