Skip to content

Commit

Permalink
test: doc generation for root command
Browse files Browse the repository at this point in the history
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
  • Loading branch information
dvdksn committed Apr 23, 2024
1 parent adf75cb commit 9712509
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 4 deletions.
2 changes: 1 addition & 1 deletion clidocstool_man_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestGenManTree(t *testing.T) {
c, err := New(Options{
Root: dockerCmd,
SourceDir: tmpdir,
Plugin: true,
Plugin: false,
ManHeader: &doc.GenManHeader{
Title: "DOCKER",
Section: "1",
Expand Down
2 changes: 1 addition & 1 deletion clidocstool_md_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestGenMarkdownTree(t *testing.T) {
c, err := New(Options{
Root: dockerCmd,
SourceDir: tmpdir,
Plugin: true,
Plugin: false,
})
require.NoError(t, err)
require.NoError(t, c.GenMarkdownTree(dockerCmd))
Expand Down
2 changes: 1 addition & 1 deletion clidocstool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func TestGenAllTree(t *testing.T) {
c, err := New(Options{
Root: dockerCmd,
SourceDir: tmpdir,
Plugin: true,
Plugin: false,
ManHeader: &doc.GenManHeader{
Title: "DOCKER",
Section: "1",
Expand Down
2 changes: 1 addition & 1 deletion clidocstool_yaml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestGenYamlTree(t *testing.T) {
c, err := New(Options{
Root: dockerCmd,
SourceDir: tmpdir,
Plugin: true,
Plugin: false,
})
require.NoError(t, err)
require.NoError(t, c.GenYamlTree(dockerCmd))
Expand Down
27 changes: 27 additions & 0 deletions fixtures/docker.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.nh
.TH "DOCKER" "1" "Jan 2020" "Docker Community" "Docker User Manuals"

.SH NAME
.PP
docker - A self-sufficient runtime for containers


.SH SYNOPSIS
.PP
\fBdocker [OPTIONS] COMMAND [ARG...]\fP


.SH DESCRIPTION
.PP
A self-sufficient runtime for containers


.SH OPTIONS
.PP
\fB-h\fP, \fB--help\fP[=false]
help for docker


.SH SEE ALSO
.PP
\fBdocker-attach(1)\fP, \fBdocker-buildx(1)\fP
16 changes: 16 additions & 0 deletions fixtures/docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# docker

<!---MARKER_GEN_START-->
A self-sufficient runtime for containers

### Subcommands

| Name | Description |
|:----------------------|:------------------------------------------------------------------------------|
| [`attach`](attach.md) | Attach local standard input, output, and error streams to a running container |
| [`buildx`](buildx.md) | Docker Buildx |



<!---MARKER_GEN_END-->

17 changes: 17 additions & 0 deletions fixtures/docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
command: docker
short: A self-sufficient runtime for containers
long: A self-sufficient runtime for containers
usage: docker [OPTIONS] COMMAND [ARG...]
cname:
- docker attach
- docker buildx
clink:
- docker_attach.yaml
- docker_buildx.yaml
deprecated: false
hidden: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false

0 comments on commit 9712509

Please sign in to comment.