diff --git a/man/generate.go b/man/generate.go index 6a0d065db5..397e3b86d1 100644 --- a/man/generate.go +++ b/man/generate.go @@ -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 @@ -63,8 +62,8 @@ 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 @@ -72,7 +71,9 @@ func loadLongDescription(cmd *cobra.Command, path string) error { 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 { diff --git a/man/tools.go b/man/tools.go index 3cafe6533a..9cbb25df4e 100644 --- a/man/tools.go +++ b/man/tools.go @@ -1,5 +1,4 @@ //go:build tools -// +build tools package main