Skip to content
Myr

Use the correct UseLine for the man page synposis.

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

authored by Daniel Nephin · committed by Daniel Nephin · parent bc81c21 · Browse files · 1 file+10 added−12 removed
This commit

State

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

Trailers

  • Signed-off-by: Daniel Nephin <dnephin@gmail.com>

Diff stats

1 file+10 added−12 removed

  • other:+10 added−12 removed

1 file+10 added−12 removed

modified:doc/man_docs.go+10 added-12 removed
105 unmodified lines
106 header.Source = "Auto generated by spf13/cobra"107 }108}109110func manPreamble(out io.Writer, header *GenManHeader, name, short, long string) {111 dashName := strings.Replace(name, " ", "-", -1)110func manPreamble(out io.Writer, header *GenManHeader, cmd *cobra.Command, dashedName string) {111 description := cmd.Long112 if len(description) == 0 {113 description = cmd.Short114 }115116 fmt.Fprintf(out, `%% %s(%s)%s117%% %s118%% %s119# NAME120`, header.Title, header.Section, header.date, header.Source, header.Manual)117 fmt.Fprintf(out, "%s \\- %s\n\n", dashName, short)121 fmt.Fprintf(out, "%s \\- %s\n\n", dashedName, cmd.Short)122 fmt.Fprintf(out, "# SYNOPSIS\n")119 fmt.Fprintf(out, "**%s** [OPTIONS]\n\n", name)123 fmt.Fprintf(out, "**%s**\n\n", cmd.UseLine())124 fmt.Fprintf(out, "# DESCRIPTION\n")121 fmt.Fprintf(out, "%s\n\n", long)125 fmt.Fprintf(out, "%s\n\n", description)126}127128func manPrintFlags(out io.Writer, flags *pflag.FlagSet) {129 flags.VisitAll(func(flag *pflag.Flag) {
47 unmodified lines
177 fillHeader(header, commandName)178179 buf := new(bytes.Buffer)180177 short := cmd.Short178 long := cmd.Long179 if len(long) == 0 {180 long = short181 }182183 manPreamble(buf, header, commandName, short, long)181 manPreamble(buf, header, cmd, dashCommandName)182 manPrintOptions(buf, cmd)183 if len(cmd.Example) > 0 {184 fmt.Fprintf(buf, "# EXAMPLE\n")185 fmt.Fprintf(buf, "```\n%s\n```\n", cmd.Example)
31 unmodified lines