mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-18 00:47:48 +08:00
go.mod: update cli-docs-tool v0.5.1 and re-generate docs
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
85040a9067
commit
c97500b117
@ -10,7 +10,7 @@ Extended build capabilities with BuildKit
|
|||||||
### Subcommands
|
### Subcommands
|
||||||
|
|
||||||
| Name | Description |
|
| Name | Description |
|
||||||
| --- | --- |
|
|:-------------------------------------|:-------------------------------------------|
|
||||||
| [`bake`](buildx_bake.md) | Build from a file |
|
| [`bake`](buildx_bake.md) | Build from a file |
|
||||||
| [`build`](buildx_build.md) | Start a build |
|
| [`build`](buildx_build.md) | Start a build |
|
||||||
| [`create`](buildx_create.md) | Create a new builder instance |
|
| [`create`](buildx_create.md) | Create a new builder instance |
|
||||||
@ -30,7 +30,7 @@ Extended build capabilities with BuildKit
|
|||||||
### Options
|
### Options
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
| --- | --- | --- | --- |
|
|:------------------------|:---------|:--------|:-----------------------------------------|
|
||||||
| [`--builder`](#builder) | `string` | | Override the configured builder instance |
|
| [`--builder`](#builder) | `string` | | Override the configured builder instance |
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ Build from a file
|
|||||||
### Options
|
### Options
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
| --- | --- | --- | --- |
|
|:---------------------------------|:--------------|:--------|:-----------------------------------------------------------------------------------------|
|
||||||
| [`--builder`](#builder) | `string` | | Override the configured builder instance |
|
| [`--builder`](#builder) | `string` | | Override the configured builder instance |
|
||||||
| [`-f`](#file), [`--file`](#file) | `stringArray` | | Build definition file |
|
| [`-f`](#file), [`--file`](#file) | `stringArray` | | Build definition file |
|
||||||
| `--load` | | | Shorthand for `--set=*.output=type=docker` |
|
| `--load` | | | Shorthand for `--set=*.output=type=docker` |
|
||||||
|
@ -14,7 +14,7 @@ Start a build
|
|||||||
### Options
|
### Options
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
| --- | --- | --- | --- |
|
|:-------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------|:----------|:----------------------------------------------------------------------------------------------------|
|
||||||
| [`--add-host`](https://docs.docker.com/engine/reference/commandline/build/#add-host) | `stringSlice` | | Add a custom host-to-IP mapping (format: `host:ip`) |
|
| [`--add-host`](https://docs.docker.com/engine/reference/commandline/build/#add-host) | `stringSlice` | | Add a custom host-to-IP mapping (format: `host:ip`) |
|
||||||
| [`--allow`](#allow) | `stringSlice` | | Allow extra privileged entitlement (e.g., `network.host`, `security.insecure`) |
|
| [`--allow`](#allow) | `stringSlice` | | Allow extra privileged entitlement (e.g., `network.host`, `security.insecure`) |
|
||||||
| `--attest` | `stringArray` | | Attestation parameters (format: `type=sbom,generator=image`) |
|
| `--attest` | `stringArray` | | Attestation parameters (format: `type=sbom,generator=image`) |
|
||||||
|
@ -10,7 +10,7 @@ Create a new builder instance
|
|||||||
### Options
|
### Options
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
| --- | --- | --- | --- |
|
|:----------------------------------------|:--------------|:--------|:----------------------------------------------------------------------|
|
||||||
| [`--append`](#append) | | | Append a node to builder instead of changing it |
|
| [`--append`](#append) | | | Append a node to builder instead of changing it |
|
||||||
| `--bootstrap` | | | Boot builder after creation |
|
| `--bootstrap` | | | Boot builder after creation |
|
||||||
| [`--buildkitd-flags`](#buildkitd-flags) | `string` | | Flags for buildkitd daemon |
|
| [`--buildkitd-flags`](#buildkitd-flags) | `string` | | Flags for buildkitd daemon |
|
||||||
|
@ -10,7 +10,7 @@ Disk usage
|
|||||||
### Options
|
### Options
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
| --- | --- | --- | --- |
|
|:------------------------|:---------|:--------|:-----------------------------------------|
|
||||||
| [`--builder`](#builder) | `string` | | Override the configured builder instance |
|
| [`--builder`](#builder) | `string` | | Override the configured builder instance |
|
||||||
| `--filter` | `filter` | | Provide filter values |
|
| `--filter` | `filter` | | Provide filter values |
|
||||||
| `--verbose` | | | Provide a more verbose output |
|
| `--verbose` | | | Provide a more verbose output |
|
||||||
|
@ -10,7 +10,7 @@ Commands to work on images in registry
|
|||||||
### Subcommands
|
### Subcommands
|
||||||
|
|
||||||
| Name | Description |
|
| Name | Description |
|
||||||
| --- | --- |
|
|:------------------------------------------|:------------------------------------------|
|
||||||
| [`create`](buildx_imagetools_create.md) | Create a new image based on source images |
|
| [`create`](buildx_imagetools_create.md) | Create a new image based on source images |
|
||||||
| [`inspect`](buildx_imagetools_inspect.md) | Show details of an image in the registry |
|
| [`inspect`](buildx_imagetools_inspect.md) | Show details of an image in the registry |
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ Commands to work on images in registry
|
|||||||
### Options
|
### Options
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
| --- | --- | --- | --- |
|
|:------------------------|:---------|:--------|:-----------------------------------------|
|
||||||
| [`--builder`](#builder) | `string` | | Override the configured builder instance |
|
| [`--builder`](#builder) | `string` | | Override the configured builder instance |
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ Create a new image based on source images
|
|||||||
### Options
|
### Options
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
| --- | --- | --- | --- |
|
|:---------------------------------|:--------------|:--------|:-----------------------------------------------------------------------------------------|
|
||||||
| [`--append`](#append) | | | Append to existing manifest |
|
| [`--append`](#append) | | | Append to existing manifest |
|
||||||
| [`--builder`](#builder) | `string` | | Override the configured builder instance |
|
| [`--builder`](#builder) | `string` | | Override the configured builder instance |
|
||||||
| [`--dry-run`](#dry-run) | | | Show final image instead of pushing |
|
| [`--dry-run`](#dry-run) | | | Show final image instead of pushing |
|
||||||
|
@ -10,7 +10,7 @@ Show details of an image in the registry
|
|||||||
### Options
|
### Options
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
| --- | --- | --- | --- |
|
|:------------------------|:---------|:----------------|:----------------------------------------------|
|
||||||
| [`--builder`](#builder) | `string` | | Override the configured builder instance |
|
| [`--builder`](#builder) | `string` | | Override the configured builder instance |
|
||||||
| [`--format`](#format) | `string` | `{{.Manifest}}` | Format the output using the given Go template |
|
| [`--format`](#format) | `string` | `{{.Manifest}}` | Format the output using the given Go template |
|
||||||
| [`--raw`](#raw) | | | Show original, unformatted JSON manifest |
|
| [`--raw`](#raw) | | | Show original, unformatted JSON manifest |
|
||||||
|
@ -10,7 +10,7 @@ Inspect current builder instance
|
|||||||
### Options
|
### Options
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
| --- | --- | --- | --- |
|
|:----------------------------|:---------|:--------|:--------------------------------------------|
|
||||||
| [`--bootstrap`](#bootstrap) | | | Ensure builder has booted before inspecting |
|
| [`--bootstrap`](#bootstrap) | | | Ensure builder has booted before inspecting |
|
||||||
| [`--builder`](#builder) | `string` | | Override the configured builder instance |
|
| [`--builder`](#builder) | `string` | | Override the configured builder instance |
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ Remove build cache
|
|||||||
### Options
|
### Options
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
| --- | --- | --- | --- |
|
|:------------------------|:---------|:--------|:------------------------------------------|
|
||||||
| `-a`, `--all` | | | Include internal/frontend images |
|
| `-a`, `--all` | | | Include internal/frontend images |
|
||||||
| [`--builder`](#builder) | `string` | | Override the configured builder instance |
|
| [`--builder`](#builder) | `string` | | Override the configured builder instance |
|
||||||
| `--filter` | `filter` | | Provide filter values (e.g., `until=24h`) |
|
| `--filter` | `filter` | | Provide filter values (e.g., `until=24h`) |
|
||||||
|
@ -10,7 +10,7 @@ Remove a builder instance
|
|||||||
### Options
|
### Options
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
| --- | --- | --- | --- |
|
|:------------------------------------|:---------|:--------|:-----------------------------------------|
|
||||||
| [`--all-inactive`](#all-inactive) | | | Remove all inactive builders |
|
| [`--all-inactive`](#all-inactive) | | | Remove all inactive builders |
|
||||||
| [`--builder`](#builder) | `string` | | Override the configured builder instance |
|
| [`--builder`](#builder) | `string` | | Override the configured builder instance |
|
||||||
| [`-f`](#force), [`--force`](#force) | | | Do not prompt for confirmation |
|
| [`-f`](#force), [`--force`](#force) | | | Do not prompt for confirmation |
|
||||||
|
@ -10,7 +10,7 @@ Stop builder instance
|
|||||||
### Options
|
### Options
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
| --- | --- | --- | --- |
|
|:------------------------|:---------|:--------|:-----------------------------------------|
|
||||||
| [`--builder`](#builder) | `string` | | Override the configured builder instance |
|
| [`--builder`](#builder) | `string` | | Override the configured builder instance |
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ Set the current builder instance
|
|||||||
### Options
|
### Options
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
| --- | --- | --- | --- |
|
|:------------------------|:---------|:--------|:-------------------------------------------|
|
||||||
| [`--builder`](#builder) | `string` | | Override the configured builder instance |
|
| [`--builder`](#builder) | `string` | | Override the configured builder instance |
|
||||||
| `--default` | | | Set builder as default for current context |
|
| `--default` | | | Set builder as default for current context |
|
||||||
| `--global` | | | Builder persists context changes |
|
| `--global` | | | Builder persists context changes |
|
||||||
|
2
go.mod
2
go.mod
@ -8,7 +8,7 @@ require (
|
|||||||
github.com/containerd/console v1.0.3
|
github.com/containerd/console v1.0.3
|
||||||
github.com/containerd/containerd v1.6.14
|
github.com/containerd/containerd v1.6.14
|
||||||
github.com/docker/cli v23.0.0-rc.1+incompatible
|
github.com/docker/cli v23.0.0-rc.1+incompatible
|
||||||
github.com/docker/cli-docs-tool v0.5.0
|
github.com/docker/cli-docs-tool v0.5.1
|
||||||
github.com/docker/distribution v2.8.1+incompatible
|
github.com/docker/distribution v2.8.1+incompatible
|
||||||
github.com/docker/docker v23.0.0-rc.1+incompatible
|
github.com/docker/docker v23.0.0-rc.1+incompatible
|
||||||
github.com/docker/go-units v0.5.0
|
github.com/docker/go-units v0.5.0
|
||||||
|
4
go.sum
4
go.sum
@ -165,8 +165,8 @@ github.com/distribution/distribution/v3 v3.0.0-20220725133111-4bf3547399eb h1:oC
|
|||||||
github.com/distribution/distribution/v3 v3.0.0-20220725133111-4bf3547399eb/go.mod h1:28YO/VJk9/64+sTGNuYaBjWxrXTPrj0C0XmgTIOjxX4=
|
github.com/distribution/distribution/v3 v3.0.0-20220725133111-4bf3547399eb/go.mod h1:28YO/VJk9/64+sTGNuYaBjWxrXTPrj0C0XmgTIOjxX4=
|
||||||
github.com/docker/cli v23.0.0-rc.1+incompatible h1:Vl3pcUK4/LFAD56Ys3BrqgAtuwpWd/IO3amuSL0ZbP0=
|
github.com/docker/cli v23.0.0-rc.1+incompatible h1:Vl3pcUK4/LFAD56Ys3BrqgAtuwpWd/IO3amuSL0ZbP0=
|
||||||
github.com/docker/cli v23.0.0-rc.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
|
github.com/docker/cli v23.0.0-rc.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
|
||||||
github.com/docker/cli-docs-tool v0.5.0 h1:EjGwI6EyB7YemHCC7R8mwXszJTbuq0T0pFuDC5bMhcE=
|
github.com/docker/cli-docs-tool v0.5.1 h1:jIk/cCZurZERhALPVKhqlNxTQGxn2kcI+56gE57PQXg=
|
||||||
github.com/docker/cli-docs-tool v0.5.0/go.mod h1:zMjqTFCU361PRh8apiXzeAZ1Q/xupbIwTusYpzCXS/o=
|
github.com/docker/cli-docs-tool v0.5.1/go.mod h1:zMjqTFCU361PRh8apiXzeAZ1Q/xupbIwTusYpzCXS/o=
|
||||||
github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68=
|
github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68=
|
||||||
github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
||||||
github.com/docker/docker v23.0.0-rc.1+incompatible h1:Dmn88McWuHc7BSNN1s6RtfhMmt6ZPQAYUEf7FhqpiQI=
|
github.com/docker/docker v23.0.0-rc.1+incompatible h1:Dmn88McWuHc7BSNN1s6RtfhMmt6ZPQAYUEf7FhqpiQI=
|
||||||
|
2
vendor/github.com/docker/cli-docs-tool/README.md
generated
vendored
2
vendor/github.com/docker/cli-docs-tool/README.md
generated
vendored
@ -1,5 +1,5 @@
|
|||||||
[](https://pkg.go.dev/github.com/docker/cli-docs-tool)
|
[](https://pkg.go.dev/github.com/docker/cli-docs-tool)
|
||||||
[](https://github.com/docker/cli-docs-tool/actions?query=workflow%3Atest)
|
[](https://github.com/docker/cli-docs-tool/actions?query=workflow%3Atest)
|
||||||
[](https://goreportcard.com/report/github.com/docker/cli-docs-tool)
|
[](https://goreportcard.com/report/github.com/docker/cli-docs-tool)
|
||||||
|
|
||||||
## About
|
## About
|
||||||
|
84
vendor/github.com/docker/cli-docs-tool/clidocstool_md.go
generated
vendored
84
vendor/github.com/docker/cli-docs-tool/clidocstool_md.go
generated
vendored
@ -20,7 +20,9 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
"text/tabwriter"
|
||||||
"text/template"
|
"text/template"
|
||||||
|
|
||||||
"github.com/docker/cli-docs-tool/annotation"
|
"github.com/docker/cli-docs-tool/annotation"
|
||||||
@ -28,6 +30,11 @@ import (
|
|||||||
"github.com/spf13/pflag"
|
"github.com/spf13/pflag"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
nlRegexp = regexp.MustCompile(`\r?\n`)
|
||||||
|
adjustSep = regexp.MustCompile(`\|:---(\s+)`)
|
||||||
|
)
|
||||||
|
|
||||||
// GenMarkdownTree will generate a markdown page for this command and all
|
// GenMarkdownTree will generate a markdown page for this command and all
|
||||||
// descendants in the directory given.
|
// descendants in the directory given.
|
||||||
func (c *Client) GenMarkdownTree(cmd *cobra.Command) error {
|
func (c *Client) GenMarkdownTree(cmd *cobra.Command) error {
|
||||||
@ -144,6 +151,42 @@ func mdMakeLink(txt, link string, f *pflag.Flag, isAnchor bool) string {
|
|||||||
return "[" + txt + "](" + link + ")"
|
return "[" + txt + "](" + link + ")"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type mdTable struct {
|
||||||
|
out *strings.Builder
|
||||||
|
tabWriter *tabwriter.Writer
|
||||||
|
}
|
||||||
|
|
||||||
|
func newMdTable(headers ...string) *mdTable {
|
||||||
|
w := &strings.Builder{}
|
||||||
|
t := &mdTable{
|
||||||
|
out: w,
|
||||||
|
// Using tabwriter.Debug, which uses "|" as separator instead of tabs,
|
||||||
|
// which is what we want. It's a bit of a hack, but does the job :)
|
||||||
|
tabWriter: tabwriter.NewWriter(w, 5, 5, 1, ' ', tabwriter.Debug),
|
||||||
|
}
|
||||||
|
t.addHeader(headers...)
|
||||||
|
return t
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t *mdTable) addHeader(cols ...string) {
|
||||||
|
t.AddRow(cols...)
|
||||||
|
_, _ = t.tabWriter.Write([]byte("|" + strings.Repeat(":---\t", len(cols)) + "\n"))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t *mdTable) AddRow(cols ...string) {
|
||||||
|
for i := range cols {
|
||||||
|
cols[i] = mdEscapePipe(cols[i])
|
||||||
|
}
|
||||||
|
_, _ = t.tabWriter.Write([]byte("| " + strings.Join(cols, "\t ") + "\t\n"))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t *mdTable) String() string {
|
||||||
|
_ = t.tabWriter.Flush()
|
||||||
|
return adjustSep.ReplaceAllStringFunc(t.out.String()+"\n", func(in string) string {
|
||||||
|
return strings.ReplaceAll(in, " ", "-")
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
func mdCmdOutput(cmd *cobra.Command, old string) (string, error) {
|
func mdCmdOutput(cmd *cobra.Command, old string) (string, error) {
|
||||||
b := &strings.Builder{}
|
b := &strings.Builder{}
|
||||||
|
|
||||||
@ -152,46 +195,41 @@ func mdCmdOutput(cmd *cobra.Command, old string) (string, error) {
|
|||||||
desc = cmd.Long
|
desc = cmd.Long
|
||||||
}
|
}
|
||||||
if desc != "" {
|
if desc != "" {
|
||||||
fmt.Fprintf(b, "%s\n\n", desc)
|
b.WriteString(desc + "\n\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
if aliases := getAliases(cmd); len(aliases) != 0 {
|
if aliases := getAliases(cmd); len(aliases) != 0 {
|
||||||
fmt.Fprint(b, "### Aliases\n\n")
|
b.WriteString("### Aliases\n\n")
|
||||||
fmt.Fprint(b, "`"+strings.Join(aliases, "`, `")+"`")
|
b.WriteString("`" + strings.Join(aliases, "`, `") + "`")
|
||||||
fmt.Fprint(b, "\n\n")
|
b.WriteString("\n\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(cmd.Commands()) != 0 {
|
if len(cmd.Commands()) != 0 {
|
||||||
fmt.Fprint(b, "### Subcommands\n\n")
|
b.WriteString("### Subcommands\n\n")
|
||||||
fmt.Fprint(b, "| Name | Description |\n")
|
table := newMdTable("Name", "Description")
|
||||||
fmt.Fprint(b, "| --- | --- |\n")
|
|
||||||
for _, c := range cmd.Commands() {
|
for _, c := range cmd.Commands() {
|
||||||
fmt.Fprintf(b, "| [`%s`](%s) | %s |\n", c.Name(), mdFilename(c), c.Short)
|
table.AddRow(fmt.Sprintf("[`%s`](%s)", c.Name(), mdFilename(c)), c.Short)
|
||||||
}
|
}
|
||||||
fmt.Fprint(b, "\n\n")
|
b.WriteString(table.String() + "\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
// add inherited flags before checking for flags availability
|
// add inherited flags before checking for flags availability
|
||||||
cmd.Flags().AddFlagSet(cmd.InheritedFlags())
|
cmd.Flags().AddFlagSet(cmd.InheritedFlags())
|
||||||
|
|
||||||
if cmd.Flags().HasAvailableFlags() {
|
if cmd.Flags().HasAvailableFlags() {
|
||||||
fmt.Fprint(b, "### Options\n\n")
|
b.WriteString("### Options\n\n")
|
||||||
fmt.Fprint(b, "| Name | Type | Default | Description |\n")
|
table := newMdTable("Name", "Type", "Default", "Description")
|
||||||
fmt.Fprint(b, "| --- | --- | --- | --- |\n")
|
|
||||||
|
|
||||||
cmd.Flags().VisitAll(func(f *pflag.Flag) {
|
cmd.Flags().VisitAll(func(f *pflag.Flag) {
|
||||||
if f.Hidden {
|
if f.Hidden {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
isLink := strings.Contains(old, "<a name=\""+f.Name+"\"></a>")
|
isLink := strings.Contains(old, "<a name=\""+f.Name+"\"></a>")
|
||||||
fmt.Fprint(b, "| ")
|
var name string
|
||||||
if f.Shorthand != "" {
|
if f.Shorthand != "" {
|
||||||
name := "`-" + f.Shorthand + "`"
|
name = mdMakeLink("`-"+f.Shorthand+"`", f.Name, f, isLink)
|
||||||
name = mdMakeLink(name, f.Name, f, isLink)
|
name += ", "
|
||||||
fmt.Fprintf(b, "%s, ", name)
|
|
||||||
}
|
}
|
||||||
name := "`--" + f.Name + "`"
|
name += mdMakeLink("`--"+f.Name+"`", f.Name, f, isLink)
|
||||||
name = mdMakeLink(name, f.Name, f, isLink)
|
|
||||||
|
|
||||||
var ftype string
|
var ftype string
|
||||||
if f.Value.Type() != "bool" {
|
if f.Value.Type() != "bool" {
|
||||||
@ -216,9 +254,9 @@ func mdCmdOutput(cmd *cobra.Command, old string) (string, error) {
|
|||||||
} else if cd, ok := cmd.Annotations[annotation.CodeDelimiter]; ok {
|
} else if cd, ok := cmd.Annotations[annotation.CodeDelimiter]; ok {
|
||||||
usage = strings.ReplaceAll(usage, cd, "`")
|
usage = strings.ReplaceAll(usage, cd, "`")
|
||||||
}
|
}
|
||||||
fmt.Fprintf(b, "%s | %s | %s | %s |\n", mdEscapePipe(name), mdEscapePipe(ftype), mdEscapePipe(defval), mdEscapePipe(usage))
|
table.AddRow(name, ftype, defval, mdReplaceNewline(usage))
|
||||||
})
|
})
|
||||||
fmt.Fprintln(b, "")
|
b.WriteString(table.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
return b.String(), nil
|
return b.String(), nil
|
||||||
@ -227,3 +265,7 @@ func mdCmdOutput(cmd *cobra.Command, old string) (string, error) {
|
|||||||
func mdEscapePipe(s string) string {
|
func mdEscapePipe(s string) string {
|
||||||
return strings.ReplaceAll(s, `|`, `\|`)
|
return strings.ReplaceAll(s, `|`, `\|`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func mdReplaceNewline(s string) string {
|
||||||
|
return nlRegexp.ReplaceAllString(s, "<br>")
|
||||||
|
}
|
||||||
|
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@ -219,7 +219,7 @@ github.com/docker/cli/cli/streams
|
|||||||
github.com/docker/cli/cli/trust
|
github.com/docker/cli/cli/trust
|
||||||
github.com/docker/cli/cli/version
|
github.com/docker/cli/cli/version
|
||||||
github.com/docker/cli/opts
|
github.com/docker/cli/opts
|
||||||
# github.com/docker/cli-docs-tool v0.5.0
|
# github.com/docker/cli-docs-tool v0.5.1
|
||||||
## explicit; go 1.18
|
## explicit; go 1.18
|
||||||
github.com/docker/cli-docs-tool
|
github.com/docker/cli-docs-tool
|
||||||
github.com/docker/cli-docs-tool/annotation
|
github.com/docker/cli-docs-tool/annotation
|
||||||
|
Loading…
x
Reference in New Issue
Block a user