Skip to content

Commit 7dc35c0

Browse files
committed
validate manpages target
Signed-off-by: CrazyMax <[email protected]>
1 parent a650f4d commit 7dc35c0

50 files changed

Lines changed: 88 additions & 10065 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
/cli/winresources/versioninfo.json
33
/cli/winresources/*.syso
44
/man/man*/
5+
/man/vendor/
6+
/man/go.sum
57
/docs/yaml/
68
/docs/vendor/
79
/docs/go.sum

.github/workflows/validate.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
matrix:
4141
target:
4242
- yamldocs # ensure yamldocs target runs fine
43+
- manpages # ensure manpages target runs fine
4344
steps:
4445
-
4546
name: Checkout
@@ -48,5 +49,6 @@ jobs:
4849
fetch-depth: 0
4950
-
5051
name: Run
52+
shell: 'script --return --quiet --command "bash {0}"'
5153
run: |
5254
make -f docker.Makefile ${{ matrix.target }}

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ Thumbs.db
1010
/build/
1111
/cli/winresources/versioninfo.json
1212
/cli/winresources/*.syso
13-
/man/man1/
14-
/man/man5/
15-
/man/man8/
1613
profile.out
1714

1815
# top-level go.mod is not meant to be checked in

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ _:=$(shell ./scripts/warn-outside-container $(MAKECMDGOALS))
1111

1212
.PHONY: clean
1313
clean: ## remove build artifacts
14-
rm -rf ./build/* cli/winresources/rsrc_* ./man/man[1-9] docs/yaml
14+
rm -rf ./build/* man/man[1-9] docs/yaml
1515

1616
.PHONY: test
1717
test: test-unit ## run tests

man/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/vendor
2+
/man*
3+
/go.sum

man/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ Cobra command or amend the Markdown files for legacy pages.
1212

1313
From within the project root directory run:
1414

15-
make manpages
15+
```shell
16+
$ make -f docker.Makefile manpages
17+
```

man/generate.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// This file is intended for use with "go run"; it isn't really part of the package.
2+
3+
// +build manpages
4+
15
package main
26

37
import (
@@ -18,6 +22,8 @@ import (
1822
const descriptionSourcePath = "man/src/"
1923

2024
func generateManPages(opts *options) error {
25+
log.SetFlags(0)
26+
2127
header := &doc.GenManHeader{
2228
Title: "DOCKER",
2329
Section: "1",
@@ -73,6 +79,7 @@ func loadLongDescription(cmd *cobra.Command, path string) error {
7379
continue
7480
}
7581

82+
log.Printf("INFO: %s found\n", fullpath)
7683
content, err := os.ReadFile(fullpath)
7784
if err != nil {
7885
return err

man/go.mod

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module github.com/docker/cli/man
2+
3+
// dummy go.mod to avoid dealing with dependencies specific
4+
// to manpages generation and not really part of the project.
5+
6+
go 1.16
7+
8+
//require (
9+
// github.com/docker/cli v0.0.0+incompatible
10+
// github.com/cpuguy83/go-md2man/v2 v2.0.1
11+
// github.com/spf13/cobra v1.2.1
12+
// github.com/spf13/pflag v1.0.5
13+
//)
14+
//
15+
//replace github.com/docker/cli v0.0.0+incompatible => ../

man/import.go

Lines changed: 0 additions & 7 deletions
This file was deleted.

man/md2man-all.sh

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)