From 78cc4dd32763bc7f4ecdbe253c9cddc9c95e919d Mon Sep 17 00:00:00 2001 From: rhatgadkar-goog Date: Wed, 4 Dec 2024 02:39:39 +0000 Subject: [PATCH] Address PR comments --- .github/workflows/docs.yml | 2 +- README.md | 3 ++- cmd/gendocs/gen_alloydb-proxy_docs.go | 14 ++++++++------ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 8ee66d46..36f8eba2 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -34,4 +34,4 @@ jobs: run: | go install ./cmd/gendocs gendocs - git diff --exit-code \ No newline at end of file + git diff --exit-code diff --git a/README.md b/README.md index ea3f111f..2a1986e6 100644 --- a/README.md +++ b/README.md @@ -315,7 +315,8 @@ debug = true debug-logs = true ``` -Run `./alloydb-auth-proxy --help` for more details. +Run `./alloydb-auth-proxy --help` for more details. See the full documentation +in [docs/cmd](docs/cmd). ## Running behind a Socks5 proxy diff --git a/cmd/gendocs/gen_alloydb-proxy_docs.go b/cmd/gendocs/gen_alloydb-proxy_docs.go index cb8fcf0f..8662c2ce 100644 --- a/cmd/gendocs/gen_alloydb-proxy_docs.go +++ b/cmd/gendocs/gen_alloydb-proxy_docs.go @@ -24,12 +24,14 @@ import ( ) 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] - } else if len(os.Args) > 2 { - fmt.Fprintf(os.Stderr, "usage: %s [output directory]\n", os.Args[0]) - os.Exit(1) } outDir, err := filepath.Abs(path) @@ -42,7 +44,7 @@ func main() { // regardless of where we run. os.Setenv("TMPDIR", "/tmp") - alloyDBAuthProxy := cmd.NewCommand() - alloyDBAuthProxy.Execute() - doc.GenMarkdownTree(alloyDBAuthProxy.Command, outDir) + c := cmd.NewCommand() + c.Execute() + doc.GenMarkdownTree(c.Command, outDir) }