1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-06 03:13:48 +02:00
goreleaser/cmd/docs.go
Carlos Alexandro Becker 700ff34236
docs: improving docs (#4956)
slowly but steadily fixing a billion warnings
2024-07-08 23:30:10 -03:00

35 lines
774 B
Go

package cmd
import (
"github.com/spf13/cobra"
"github.com/spf13/cobra/doc"
)
type docsCmd struct {
cmd *cobra.Command
}
func newDocsCmd() *docsCmd {
root := &docsCmd{}
cmd := &cobra.Command{
Use: "docs",
Short: "Generates GoReleaser's command line docs",
SilenceUsage: true,
DisableFlagsInUseLine: true,
Hidden: true,
Args: cobra.NoArgs,
ValidArgsFunction: cobra.NoFileCompletions,
RunE: func(_ *cobra.Command, _ []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 s
})
},
}
root.cmd = cmd
return root
}