Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit d2e6f2a

Browse files
Add plural to the header
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
1 parent 107130f commit d2e6f2a

5 files changed

Lines changed: 16 additions & 12 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ Commands:
255255
fork Create a fork of an existing application to be modified
256256
helm Generate a Helm chart
257257
init Start building a Docker application
258-
inspect Shows metadata and settings for a given application
258+
inspect Shows metadata, settings and a summary of the compose file for a given application
259259
merge Merge a multi-file application into a single file
260260
push Push the application to a registry
261261
render Render the Compose file for the application

e2e/testdata/envvariables-inspect.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Service (1) Replicas Ports Image
66
----------- -------- ----- -----
77
test 1 alpine:latest
88

9-
Setting (4) Value
10-
----------- -----
9+
Settings (4) Value
10+
------------ -----
1111
myapp.alpine_version latest
1212
myapp.command1 cat
1313
myapp.command2 foo

e2e/testdata/helloworld-inspect.golden

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Service (1) Replicas Ports Image
88
----------- -------- ----- -----
99
hello 1 8080 hashicorp/http-echo
1010

11-
Setting (2) Value
12-
----------- -----
13-
port 8080
14-
text Hello, World!
11+
Settings (2) Value
12+
------------ -----
13+
port 8080
14+
text Hello, World!

internal/inspect/inspect.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ func printSection(out io.Writer, len int, printer func(io.Writer), headers ...st
8787
}
8888
fmt.Fprintln(out)
8989
w := tabwriter.NewWriter(out, 0, 0, 1, ' ', 0)
90-
headers[0] = fmt.Sprintf("%s (%d)", headers[0], len)
90+
var plural string
91+
if len > 1 {
92+
plural = "s"
93+
}
94+
headers[0] = fmt.Sprintf("%s%s (%d)", headers[0], plural, len)
9195
printHeaders(w, headers...)
9296
printer(w)
9397
w.Flush()

internal/inspect/testdata/inspect-full.golden

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Secret (1)
2020
----------
2121
my-secret
2222

23-
Setting (2) Value
24-
----------- -----
25-
port 8080
26-
text hello
23+
Settings (2) Value
24+
------------ -----
25+
port 8080
26+
text hello

0 commit comments

Comments
 (0)