Auto generation of a man page

This commit is contained in:
Eric Paris
2015-08-18 15:33:41 -07:00
parent db05184446
commit 9e7788657f
7 changed files with 325 additions and 8 deletions

View File

@ -212,7 +212,7 @@ func postscript(out *bytes.Buffer, name string) {
func writeCommands(cmd *Command, out *bytes.Buffer) {
fmt.Fprintf(out, " commands=()\n")
for _, c := range cmd.Commands() {
if len(c.Deprecated) > 0 {
if len(c.Deprecated) > 0 || c == cmd.helpCommand {
continue
}
fmt.Fprintf(out, " commands+=(%q)\n", c.Name())
@ -321,7 +321,7 @@ func writeRequiredNoun(cmd *Command, out *bytes.Buffer) {
func gen(cmd *Command, out *bytes.Buffer) {
for _, c := range cmd.Commands() {
if len(c.Deprecated) > 0 {
if len(c.Deprecated) > 0 || c == cmd.helpCommand {
continue
}
gen(c, out)