Generate man pages before building the debian package
This commit is contained in:
parent
82527e7703
commit
fd3f363a17
5 changed files with 32 additions and 9 deletions
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue