INNER CODE UNIT · Go
disableAutoGenTag
dropbox/dbxcli · tools/gen-docs/main.go:80
func disableAutoGenTag(command *cobra.Command) {
command.DisableAutoGenTag = true
for _, child := range command.Commands() {
disableAutoGenTag(child)
}
}
func addCommandMetadata(root *cobra.Command) error {
return walkCommands(root, func(command *cobra.Command) error {
path := filepath.Join(outputDir, strings.ReplaceAll(command.CommandPath(), " ", "_")+".md")
contents, err := os.ReadFile(path)
if err != nil {
return fmt.Errorf("read generated doc %s: %w", path, err)
}
updated := insertMetadataSection(contents, commandMetadataSection(command))
if err := os.WriteFile(path, updated, 0o644); err != nil {
return fmt.Errorf("write generated doc %s: %w", path, err)