blob: ff7f6fb1b6a465d3e03fd818638222e6ade8da0e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
package cmd
import (
"github.com/spf13/cobra"
"github.com/spf13/cobra/doc"
)
func init() {
rootCmd.AddCommand(manCmd)
}
var manCmd = &cobra.Command{
Use: "man directory",
Short: "Generate man pages and write them to given directory",
Args: cobra.ExactArgs(1),
Hidden: true, // Not intended to be called by users
DisableAutoGenTag: true,
Run: func(cmd *cobra.Command, args []string) {
dir := args[0]
err := doc.GenManTree(rootCmd, nil, dir)
if err != nil {
fatalErr(err, "Failed to write man pages")
return
}
printSuccess("Man pages written to ", dir)
},
}
|