Skip to content

Commit

Permalink
update docs make file with man pages generation
Browse files Browse the repository at this point in the history
  • Loading branch information
tharun208 committed Jun 16, 2021
1 parent 59c7e3b commit cfc6448
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 879 deletions.
29 changes: 0 additions & 29 deletions app/kumactl/cmd/completion/completion.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
package completion

import (
"fmt"

"github.com/spf13/cobra"
"github.com/spf13/cobra/doc"

kumactl_cmd "github.com/kumahq/kuma/app/kumactl/pkg/cmd"
kuma_version "github.com/kumahq/kuma/pkg/version"
)

const completionLong = `
Expand Down Expand Up @@ -74,28 +70,3 @@ func newZshCommand(pctx *kumactl_cmd.RootContext) *cobra.Command {
}
return cmd
}

func NewGenManCommand() *cobra.Command {
var path string
cmd := &cobra.Command{
Use: "genman",
Short: "Generate man pages for the kuma CLI",
Long: `This command automatically generates up-to-date man pages of kuma's command-line interface.`,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.Root().DisableAutoGenTag = true
header := &doc.GenManHeader{
Section: "1",
Manual: "Kuma CLI Manual",
Source: fmt.Sprintf("kumactl %s", kuma_version.Build.Version),
}
err := doc.GenManTree(cmd.Root(), header, path)
if err != nil {
return err
}
return nil
},
}

cmd.Flags().StringVarP(&path, "output-dir", "o", "/tmp/", "directory to populate with documentation")
return cmd
}
1 change: 0 additions & 1 deletion app/kumactl/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ func NewRootCmd(root *kumactl_cmd.RootContext) *cobra.Command {
cmd.AddCommand(inspect.NewInspectCmd(root))
cmd.AddCommand(install.NewInstallCmd(root))
cmd.AddCommand(uninstall.NewUninstallCmd(root))
cmd.AddCommand(completion.NewGenManCommand())
cmd.AddCommand(version.NewVersionCmd())
kumactl_cmd.WrapRunnables(cmd, kumactl_errors.FormatErrorWrapper)
return cmd
Expand Down
Loading

0 comments on commit cfc6448

Please sign in to comment.