Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions man/generate.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// This file is intended for use with "go run"; it isn't really part of the package.

//go:build manpages
// +build manpages

package main

Expand Down Expand Up @@ -63,16 +62,18 @@ func generateManPages(opts *options) error {
})
}

func loadLongDescription(cmd *cobra.Command, path string) error {
for _, cmd := range cmd.Commands() {
func loadLongDescription(parentCommand *cobra.Command, path string) error {
for _, cmd := range parentCommand.Commands() {
cmd.DisableFlagsInUseLine = true
if cmd.Name() == "" {
continue
}
fullpath := filepath.Join(path, cmd.Name()+".md")

if cmd.HasSubCommands() {
loadLongDescription(cmd, filepath.Join(path, cmd.Name()))
if err := loadLongDescription(cmd, filepath.Join(path, cmd.Name())); err != nil {
return err
}
}

if _, err := os.Stat(fullpath); err != nil {
Expand Down
1 change: 0 additions & 1 deletion man/tools.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build tools
// +build tools

package main

Expand Down