mirror of
https://github.com/spf13/cobra
synced 2024-11-24 14:47:12 +00:00
Simplify GenMarkdownTreeCustom signature
This commit is contained in:
parent
5fa1003a36
commit
ea06b29c10
2 changed files with 2 additions and 2 deletions
|
@ -111,7 +111,7 @@ func GenMarkdownTree(cmd *cobra.Command, dir string) {
|
||||||
GenMarkdownTreeCustom(cmd, dir, emptyStr, identity)
|
GenMarkdownTreeCustom(cmd, dir, emptyStr, identity)
|
||||||
}
|
}
|
||||||
|
|
||||||
func GenMarkdownTreeCustom(cmd *cobra.Command, dir string, filePrepender func(string) string, linkHandler func(string) string) {
|
func GenMarkdownTreeCustom(cmd *cobra.Command, dir string, filePrepender, linkHandler func(string) string) {
|
||||||
for _, c := range cmd.Commands() {
|
for _, c := range cmd.Commands() {
|
||||||
if !c.IsAvailableCommand() || c.IsHelpCommand() {
|
if !c.IsAvailableCommand() || c.IsHelpCommand() {
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -39,7 +39,7 @@ This will write the markdown doc for ONLY "cmd" into the out, buffer.
|
||||||
Both `GenMarkdown` and `GenMarkdownTree` have alternate versions with callbacks to get some control of the output:
|
Both `GenMarkdown` and `GenMarkdownTree` have alternate versions with callbacks to get some control of the output:
|
||||||
|
|
||||||
```go
|
```go
|
||||||
func GenMarkdownTreeCustom(cmd *Command, dir string, filePrepender func(string) string, linkHandler func(string) string) {
|
func GenMarkdownTreeCustom(cmd *Command, dir string, filePrepender, linkHandler func(string) string) {
|
||||||
//...
|
//...
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in a new issue