mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-08 03:31:59 +02:00
a5d3e7bf4b
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
36 lines
786 B
Go
36 lines
786 B
Go
package cmd
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/muesli/coral"
|
|
"github.com/muesli/coral/doc"
|
|
)
|
|
|
|
type docsCmd struct {
|
|
cmd *coral.Command
|
|
}
|
|
|
|
func newDocsCmd() *docsCmd {
|
|
root := &docsCmd{}
|
|
cmd := &coral.Command{
|
|
Use: "docs",
|
|
Short: "Generates GoReleaser's command line docs",
|
|
SilenceUsage: true,
|
|
DisableFlagsInUseLine: true,
|
|
Hidden: true,
|
|
Args: coral.NoArgs,
|
|
RunE: func(cmd *coral.Command, args []string) error {
|
|
root.cmd.Root().DisableAutoGenTag = true
|
|
return doc.GenMarkdownTreeCustom(root.cmd.Root(), "www/docs/cmd", func(_ string) string {
|
|
return ""
|
|
}, func(s string) string {
|
|
return "/cmd/" + strings.TrimSuffix(s, ".md") + "/"
|
|
})
|
|
},
|
|
}
|
|
|
|
root.cmd = cmd
|
|
return root
|
|
}
|