blob: 12912718e436f51ca72260bfa4de86c4dd248c20 (
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
28
29
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package cmd
import (
"fmt"
"github.com/spf13/cobra"
"github.com/spf13/cobra/doc"
)
func newManCmd(cli *CLI) *cobra.Command {
return &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,
SilenceUsage: true,
RunE: func(cmd *cobra.Command, args []string) error {
dir := args[0]
err := doc.GenManTree(cli.cmd, nil, dir)
if err != nil {
return fmt.Errorf("failed to write man pages: %w", err)
}
cli.printSuccess("Man pages written to ", dir)
return nil
},
}
}
|