You've already forked goreleaser
mirror of
https://github.com/goreleaser/goreleaser.git
synced 2026-04-28 20:15:32 +02:00
38c449116c
That lib is quite old, we can do it simpler now :) --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
35 lines
771 B
Go
35 lines
771 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(cmd *cobra.Command, _ []string) error {
|
|
root.cmd.Root().DisableAutoGenTag = true
|
|
return doc.GenMarkdownTreeCustom(cmd.Root(), "www/docs/cmd", func(_ string) string {
|
|
return ""
|
|
}, func(s string) string {
|
|
return s
|
|
})
|
|
},
|
|
}
|
|
|
|
root.cmd = cmd
|
|
return root
|
|
}
|