Generate man pages before building the debian package

This commit is contained in:
Finn 2021-02-02 17:13:31 -08:00
parent 82527e7703
commit fd3f363a17
5 changed files with 32 additions and 9 deletions

View file

@ -32,8 +32,20 @@ var DocCmd = &cobra.Command{
Aliases: []string{"docs"},
Hidden: true,
Annotations: map[string]string{common.AnnotationNoSocketConnection: "true"},
Run: func(_ *cobra.Command, _ []string) {
err := doc.GenMarkdownTreeCustom(RootCmd, "./docs/content/signaldctl", filePrepender, linkHandler)
Run: func(_ *cobra.Command, args []string) {
var err error
outpath := "./"
if len(args) > 0 {
outpath = args[0]
}
switch common.OutputFormat {
case common.OutputFormatMan:
err = doc.GenManTree(RootCmd, &doc.GenManHeader{Title: "signaldctl"}, outpath)
case common.OutputFormatMarkdown:
err = doc.GenMarkdownTreeCustom(RootCmd, outpath, filePrepender, linkHandler)
case common.OutputFormatYAML:
err = doc.GenYamlTree(RootCmd, outpath)
}
if err != nil {
log.Fatal(err)
}

View file

@ -7,12 +7,14 @@ import (
)
const (
OutputFormatDefault = "default"
OutputFormatCSV = "csv"
OutputFormatTable = "table"
OutputFormatJSON = "json"
OutputFormatYAML = "yaml"
OutputFormatQR = "qr"
OutputFormatDefault = "default"
OutputFormatCSV = "csv"
OutputFormatTable = "table"
OutputFormatJSON = "json"
OutputFormatYAML = "yaml"
OutputFormatQR = "qr"
OutputFormatMarkdown = "md"
OutputFormatMan = "man"
AnnotationNoSocketConnection = "no-socket"
)