<commit_before># Generating Man Pages For Your Own cobra.Command

Generating man pages from a cobra command is incredibly easy. An example is as follows:

```go
package main

import (
	"github.com/spf13/cobra"
	"github.com/spf13/cobra/doc"
)

func main() {
	cmd := &cobra.Command{
		Use:   "test",
		Short: "my test program",
	}
	header := &cobra.GenManHeader{
		Title: "MINE",
		Section: "3",
	}
	doc.GenManTree(cmd, header, "/tmp")
}
```

That will get you a man page `/tmp/test.1`<commit_msg>Update doc/man_docs.md (#363)<commit_after># Generating Man Pages For Your Own cobra.Command

Generating man pages from a cobra command is incredibly easy. An example is as follows:

```go
package main

import (
	"github.com/spf13/cobra"
	"github.com/spf13/cobra/doc"
)

func main() {
	cmd := &cobra.Command{
		Use:   "test",
		Short: "my test program",
	}
	header := &doc.GenManHeader{
		Title: "MINE",
		Section: "3",
	}
	doc.GenManTree(cmd, header, "/tmp")
}
```

That will get you a man page `/tmp/test.3`
{'fraction_non_alphanumeric': 0.14641434262948208, 'fraction_numerical': 0.014940239043824702, 'mean_word_length': 3.8086124401913874, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2589338', 'n_tokens_mistral': 410, 'n_tokens_neox': 387, 'n_words': 113}