Skip to content

Commit ec8d4f1

Browse files
authored
Disable date stamp in command line reference documentation (#825)
By default, Cobra automatically adds a date stamp to the generated command line reference content. Having a date stamp is not necessarily a bad thing, though it's also doubtful that it is useful enough to justify its presence. However, the formatting of this date stamp causes it to be shown as an item in the table of contents of each command reference page, inappropriately located under the "SEE ALSO" heading. This clutters up the documentation without providing any benefits at all. Fortunately, Cobra has provided an option to disable this behavior: https://github.com/spf13/cobra/blob/master/doc/README.md#disableautogentag
1 parent 7ed171c commit ec8d4f1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: docsgen/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ func main() {
2929
}
3030

3131
cli := cli.NewCommand()
32+
cli.DisableAutoGenTag = true // Disable addition of auto-generated date stamp
3233
err := doc.GenMarkdownTree(cli, os.Args[1])
3334
if err != nil {
3435
log.Fatal(err)

0 commit comments

Comments
 (0)