Skip to content

Commit

Permalink
Reorder the generated doc lines
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilsbhat committed Jun 10, 2023
1 parent 8f89720 commit 939b4f6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions document.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func getDocs(app *cli.App, logger *logrus.Logger) string {
buffer := bytes.Buffer{}

buffer.WriteString(fmt.Sprintf("# `%s`\n\n", app.Name))
buffer.WriteString(fmt.Sprintf("%s\n%s - <%s>\n\n", app.Usage, app.Version, app.Authors[0].String()))
buffer.WriteString(fmt.Sprintf("%s\n%s\n", app.Usage, app.Version))

if app.Description != "" {
buffer.WriteString(app.Description)
Expand Down Expand Up @@ -64,10 +64,15 @@ func getDocs(app *cli.App, logger *logrus.Logger) string {
for _, flag := range app.Flags {
buffer.WriteString(fmt.Sprintf("- `%s`\n", flag.String()))
}
buffer.WriteString("\n\n")
buffer.WriteString("\n")
}

buffer.WriteString("Authors\n")
for _, author := range app.Authors {
buffer.WriteString(fmt.Sprintf(" - %s\n", author.String()))
}

buffer.WriteString("###### Auto generated by nikhilsbhat/urfavecli-docgen on " + time.Now().Format("2-Jan-2006") + "\n")
buffer.WriteString("\n###### Auto generated by nikhilsbhat/urfavecli-docgen on " + time.Now().Format("2-Jan-2006") + "\n")

return buffer.String()
}
Expand Down

0 comments on commit 939b4f6

Please sign in to comment.