Skip to content
Myr

Ensure SEE ALSO list has no leading comma, fixing #229

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Garth Kidd · committed by Garth Kidd · parent 8e91712 · Browse files · 1 file+7 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−7 removed

  • other:+7 added−7 removed

1 file+7 added−7 removed

modified:doc/man_docs.go+7 added-7 removed
186 unmodified lines
187 fmt.Fprintf(buf, "```\n%s\n```\n", cmd.Example)188 }189 if hasSeeAlso(cmd) {190 fmt.Fprintf(buf, "# SEE ALSO\n")191 seealsos := make([]string, 0)192 if cmd.HasParent() {193 parentPath := cmd.Parent().CommandPath()194 dashParentPath := strings.Replace(parentPath, " ", "-", -1)194 fmt.Fprintf(buf, "**%s(%s)**", dashParentPath, header.Section)195 seealso := fmt.Sprintf("**%s(%s)**", dashParentPath, header.Section)196 seealsos = append(seealsos, seealso)197 cmd.VisitParents(func(c *cobra.Command) {198 if c.DisableAutoGenTag {199 cmd.DisableAutoGenTag = c.DisableAutoGenTag200 }201 })202 }203 children := cmd.Commands()204 sort.Sort(byName(children))203 for i, c := range children {205 for _, c := range children {206 if !c.IsAvailableCommand() || c.IsHelpCommand() {207 continue208 }207 if cmd.HasParent() || i > 0 {208 fmt.Fprintf(buf, ", ")209 }210 fmt.Fprintf(buf, "**%s-%s(%s)**", dashCommandName, c.Name(), header.Section)209 seealso := fmt.Sprintf("**%s-%s(%s)**", dashCommandName, c.Name(), header.Section)210 seealsos = append(seealsos, seealso)211 }212 fmt.Fprintf(buf, "\n")212 fmt.Fprintf(buf, "%s\n", strings.Join(seealsos, ", "))213 }214 if !cmd.DisableAutoGenTag {215 fmt.Fprintf(buf, "# HISTORY\n%s Auto generated by spf13/cobra\n", header.Date.Format("2-Jan-2006"))216 }
2 unmodified lines