diff --git a/clidocstool_md.go b/clidocstool_md.go index 73d05c8..7f896bd 100644 --- a/clidocstool_md.go +++ b/clidocstool_md.go @@ -53,6 +53,11 @@ func (c *Client) GenMarkdownTree(cmd *cobra.Command) error { return nil } + // Skip hidden command + if cmd.Hidden { + return nil + } + log.Printf("INFO: Generating Markdown for %q", cmd.CommandPath()) mdFile := mdFilename(cmd) sourcePath := filepath.Join(c.source, mdFile) @@ -208,6 +213,9 @@ func mdCmdOutput(cmd *cobra.Command, old string) (string, error) { b.WriteString("### Subcommands\n\n") table := newMdTable("Name", "Description") for _, c := range cmd.Commands() { + if c.Hidden { + continue + } table.AddRow(fmt.Sprintf("[`%s`](%s)", c.Name(), mdFilename(c)), c.Short) } b.WriteString(table.String() + "\n")