Fix DisableAutoGenTag usage

This commit is contained in:
comp500 2023-02-04 15:45:04 +00:00
parent 00c142c6ca
commit 0598b07b9c

View File

@ -22,7 +22,7 @@ var markdownCmd = &cobra.Command{
fmt.Printf("Error creating directory: %s\n", err)
os.Exit(1)
}
cmd.DisableAutoGenTag = true
disableTag(cmd.Root())
err = doc.GenMarkdownTree(cmd.Root(), outDir)
if err != nil {
fmt.Printf("Error generating markdown: %s\n", err)
@ -32,6 +32,13 @@ var markdownCmd = &cobra.Command{
},
}
func disableTag(cmd *cobra.Command) {
cmd.DisableAutoGenTag = true
for _, v := range cmd.Commands() {
disableTag(v)
}
}
func init() {
utilsCmd.AddCommand(markdownCmd)