chore: disable auto generated tag for CLI docs (#5905)

This was causing `make gen` to fail as the days went on!
This commit is contained in:
Kyle Carberry
2023-01-29 12:58:12 -06:00
committed by GitHub
parent 2312bc4a6e
commit eaf1b95e70
56 changed files with 11 additions and 110 deletions

View File

@ -9,6 +9,7 @@ import (
"regexp"
"strings"
"github.com/spf13/cobra"
"github.com/spf13/cobra/doc"
"github.com/coder/coder/buildinfo"
@ -63,6 +64,16 @@ func main() {
markdownDocsDir := path.Join(basePath, "docs/cli")
manifestFilepath := path.Join(basePath, "docs/manifest.json")
// Disables the "Auto generated by spf13/cobra" tag
var disableAutoGenTag func(cmd *cobra.Command)
disableAutoGenTag = func(cmd *cobra.Command) {
for _, c := range cmd.Commands() {
disableAutoGenTag(c)
}
cmd.DisableAutoGenTag = true
}
disableAutoGenTag(cmd)
// Generate markdown
err = doc.GenMarkdownTree(cmd, markdownDocsDir)
if err != nil {