diff --git a/go.mod b/go.mod index 3a535ad4..1ec5c771 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/containerd/continuity v0.4.1 github.com/containerd/typeurl/v2 v2.1.1 github.com/docker/cli v24.0.2+incompatible - github.com/docker/cli-docs-tool v0.5.1 + github.com/docker/cli-docs-tool v0.6.0 github.com/docker/distribution v2.8.2+incompatible github.com/docker/docker v24.0.2+incompatible github.com/docker/go-units v0.5.0 diff --git a/go.sum b/go.sum index 3d37832a..11298e7c 100644 --- a/go.sum +++ b/go.sum @@ -151,8 +151,8 @@ github.com/distribution/distribution/v3 v3.0.0-20230214150026-36d8c594d7aa h1:L9 github.com/distribution/distribution/v3 v3.0.0-20230214150026-36d8c594d7aa/go.mod h1:WHNsWjnIn2V1LYOrME7e8KxSeKunYHsxEm4am0BUtcI= github.com/docker/cli v24.0.2+incompatible h1:QdqR7znue1mtkXIJ+ruQMGQhpw2JzMJLRXp6zpzF6tM= github.com/docker/cli v24.0.2+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/cli-docs-tool v0.5.1 h1:jIk/cCZurZERhALPVKhqlNxTQGxn2kcI+56gE57PQXg= -github.com/docker/cli-docs-tool v0.5.1/go.mod h1:zMjqTFCU361PRh8apiXzeAZ1Q/xupbIwTusYpzCXS/o= +github.com/docker/cli-docs-tool v0.6.0 h1:Z9x10SaZgFaB6jHgz3OWooynhSa40CsWkpe5hEnG/qA= +github.com/docker/cli-docs-tool v0.6.0/go.mod h1:zMjqTFCU361PRh8apiXzeAZ1Q/xupbIwTusYpzCXS/o= github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v24.0.2+incompatible h1:eATx+oLz9WdNVkQrr0qjQ8HvRJ4bOOxfzEo8R+dA3cg= diff --git a/vendor/github.com/docker/cli-docs-tool/clidocstool_md.go b/vendor/github.com/docker/cli-docs-tool/clidocstool_md.go index 73d05c8a..1dee58c0 100644 --- a/vendor/github.com/docker/cli-docs-tool/clidocstool_md.go +++ b/vendor/github.com/docker/cli-docs-tool/clidocstool_md.go @@ -53,6 +53,12 @@ func (c *Client) GenMarkdownTree(cmd *cobra.Command) error { return nil } + // Skip hidden command + if cmd.Hidden { + log.Printf("INFO: Skipping Markdown for %q (hidden command)", cmd.CommandPath()) + return nil + } + log.Printf("INFO: Generating Markdown for %q", cmd.CommandPath()) mdFile := mdFilename(cmd) sourcePath := filepath.Join(c.source, mdFile) @@ -208,6 +214,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") diff --git a/vendor/github.com/docker/cli-docs-tool/clidocstool_yaml.go b/vendor/github.com/docker/cli-docs-tool/clidocstool_yaml.go index f6ae6b85..52352429 100644 --- a/vendor/github.com/docker/cli-docs-tool/clidocstool_yaml.go +++ b/vendor/github.com/docker/cli-docs-tool/clidocstool_yaml.go @@ -62,6 +62,7 @@ type cmdDoc struct { InheritedOptions []cmdOption `yaml:"inherited_options,omitempty"` Example string `yaml:"examples,omitempty"` Deprecated bool + Hidden bool MinAPIVersion string `yaml:"min_api_version,omitempty"` Experimental bool ExperimentalCLI bool @@ -155,6 +156,7 @@ func (c *Client) genYamlCustom(cmd *cobra.Command, w io.Writer) error { Long: forceMultiLine(cmd.Long, longMaxWidth), Example: cmd.Example, Deprecated: len(cmd.Deprecated) > 0, + Hidden: cmd.Hidden, } if len(cliDoc.Long) == 0 { diff --git a/vendor/modules.txt b/vendor/modules.txt index 373e7f00..095cbc6a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -231,7 +231,7 @@ github.com/docker/cli/cli/streams github.com/docker/cli/cli/trust github.com/docker/cli/cli/version github.com/docker/cli/opts -# github.com/docker/cli-docs-tool v0.5.1 +# github.com/docker/cli-docs-tool v0.6.0 ## explicit; go 1.18 github.com/docker/cli-docs-tool github.com/docker/cli-docs-tool/annotation