GenMarkdownTree will generate a markdown page for this command and all descendants in the directory given. The header may be nil. This function may not work correctly if your command names have `-` in them. If you have `cmd` with two subcmds, `sub` and `sub-third`, and `sub` has a subcommand called
(cmd *cobra.Command, dir string)
| 123 | // and `sub` has a subcommand called `third`, it is undefined which |
| 124 | // help output will be in the file `cmd-sub-third.1`. |
| 125 | func GenMarkdownTree(cmd *cobra.Command, dir string) error { |
| 126 | identity := func(s string) string { return s } |
| 127 | emptyStr := func(s string) string { return "" } |
| 128 | return GenMarkdownTreeCustom(cmd, dir, emptyStr, identity) |
| 129 | } |
| 130 | |
| 131 | // GenMarkdownTreeCustom is the same as GenMarkdownTree, but |
| 132 | // with custom filePrepender and linkHandler. |