Skip to content
Myr

Fix Lintian warning: manpage-has-bad-whatis-entry

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

This patch fixes the problem where lexgrog fails to parse the NAME section when the provided command contains space, e.g. "rootcmd subcmd". Explanation from Lintian: Each manual page should start with a "NAME" section, which lists the name and a brief description of the page separated by "\-". The "NAME" section is parsed by lexgrog and used to generate a database that's queried by commands like apropos and whatis. This tag indicates that lexgrog was unable to parse the NAME section of this manual page. For manual pages that document multiple programs, functions, files, or other things, the part before "\-" should list each separated by a comma and a space. Each thing listed must not contain spaces; a man page for a two-part command like "fs listacl" must use something like "fs_listacl" in the "NAME" section so that it can be parsed by lexgrog.

authored by Anthony Fok · committed by Anthony Fok · parent 46c7200 · Browse files · 1 file+2 added−1 removed
This commit

State

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

Trailers

  • Ref: lexgrog(1), groff_man(7), groff_mdoc(7)

Diff stats

1 file+2 added−1 removed

  • other:+2 added−1 removed

1 file+2 added−1 removed

modified:man_docs.go+2 added-1 removed
109 unmodified lines
110 }111}112113func manPreamble(out *bytes.Buffer, header *GenManHeader, name, short, long string) {114 dashName := strings.Replace(name, " ", "-", -1)115 fmt.Fprintf(out, `%% %s(%s)%s116%% %s117%% %s118# NAME119`, header.Title, header.Section, header.date, header.Source, header.Manual)119 fmt.Fprintf(out, "%s \\- %s\n\n", name, short)120 fmt.Fprintf(out, "%s \\- %s\n\n", dashName, short)121 fmt.Fprintf(out, "# SYNOPSIS\n")122 fmt.Fprintf(out, "**%s** [OPTIONS]\n\n", name)123 fmt.Fprintf(out, "# DESCRIPTION\n")124 fmt.Fprintf(out, "%s\n\n", long)
93 unmodified lines