Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit cde09e2

Browse files
authored
Merge pull request #2104 from crazy-max/build-metrics
Build metrics
2 parents e51e2c7 + 535fb93 commit cde09e2

File tree

15 files changed

+469
-84
lines changed

15 files changed

+469
-84
lines changed

cli/metrics/commands.go

Lines changed: 81 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -19,131 +19,133 @@ package metrics
1919
var commandFlags = []string{
2020
//added to catch scan details
2121
"--version", "--login",
22+
// added for build
23+
"--builder", "--platforms",
2224
}
2325

2426
// Generated with generatecommands/main.go
2527
var managementCommands = []string{
2628
"help",
27-
"ecs",
28-
"scan",
2929
"app",
3030
"builder",
31-
"imagetools",
3231
"buildx",
3332
"checkpoint",
33+
"compose",
3434
"config",
3535
"container",
3636
"context",
3737
"create",
38+
"ecs",
3839
"image",
40+
"imagetools",
41+
"key",
42+
"login",
43+
"logout",
3944
"manifest",
4045
"network",
4146
"node",
4247
"plugin",
48+
"scan",
4349
"secret",
4450
"service",
51+
"signer",
4552
"stack",
4653
"swarm",
4754
"system",
48-
"key",
49-
"signer",
5055
"trust",
5156
"volume",
52-
"login",
53-
"logout",
54-
"compose",
5557
}
5658

5759
var commands = []string{
60+
"aci",
61+
"add",
62+
"annotate",
63+
"attach",
64+
"azure",
65+
"b",
66+
"bake",
67+
"build",
5868
"bundle",
69+
"ca",
70+
"commit",
5971
"completion",
60-
"init",
61-
"inspect",
62-
"install",
63-
"deploy",
64-
"list",
65-
"ls",
72+
"config",
73+
"connect",
74+
"convert",
6675
"cp",
67-
"merge",
68-
"pull",
69-
"push",
70-
"render",
71-
"split",
72-
"status",
73-
"uninstall",
74-
"upgrade",
75-
"validate",
76-
"version",
77-
"build",
78-
"prune",
7976
"create",
80-
"bake",
81-
"f",
82-
"b",
83-
"du",
84-
"rm",
85-
"stop",
86-
"use",
87-
"remove",
88-
"attach",
89-
"commit",
90-
"cp",
77+
"demote",
78+
"deploy",
79+
"df",
9180
"diff",
81+
"disable",
82+
"disconnect",
83+
"down",
84+
"du",
85+
"ecs",
86+
"enable",
87+
"events",
9288
"exec",
9389
"export",
90+
"f",
91+
"generate",
92+
"history",
93+
"images",
94+
"import",
95+
"info",
96+
"init",
97+
"inspect",
98+
"install",
99+
"join",
100+
"join-token",
94101
"kill",
102+
"leave",
103+
"list",
104+
"load",
105+
"login",
106+
"logout",
95107
"logs",
96-
"ps",
108+
"ls",
109+
"merge",
97110
"pause",
98111
"port",
112+
"promote",
113+
"prune",
114+
"ps",
115+
"pull",
116+
"push",
117+
"remove",
99118
"rename",
119+
"render",
100120
"restart",
121+
"revoke",
122+
"rm",
123+
"rmi",
124+
"rollback",
101125
"run",
126+
"save",
127+
"scale",
128+
"search",
129+
"services",
130+
"set",
131+
"show",
132+
"sign",
133+
"split",
102134
"start",
103135
"stats",
136+
"status",
137+
"stop",
138+
"tag",
104139
"top",
140+
"uninstall",
141+
"unlock",
142+
"unlock-key",
105143
"unpause",
144+
"up",
106145
"update",
146+
"upgrade",
147+
"use",
148+
"validate",
149+
"version",
107150
"wait",
108-
"aci",
109-
"ecs",
110-
"show",
111-
"history",
112-
"import",
113-
"load",
114-
"images",
115-
"rmi",
116-
"save",
117-
"tag",
118-
"annotate",
119-
"connect",
120-
"disconnect",
121-
"demote",
122-
"promote",
123-
"disable",
124-
"enable",
125-
"set",
126-
"rollback",
127-
"scale",
128-
"up",
129-
"down",
130-
"services",
131-
"ca",
132-
"join",
133-
"join-token",
134-
"leave",
135-
"unlock",
136-
"unlock-key",
137-
"df",
138-
"events",
139-
"info",
140-
"generate",
141-
"add",
142-
"revoke",
143-
"sign",
144-
"login",
145-
"azure",
146-
"logout",
147-
"search",
148-
"convert",
149151
}

cli/metrics/generatecommands/main.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,26 @@ package main
1919
import (
2020
"fmt"
2121
"os/exec"
22+
"sort"
2223
"strings"
2324

2425
"github.com/docker/compose/v2/pkg/utils"
2526
)
2627

27-
var managementCommands = []string{"ecs", "scan"}
28-
29-
var commands = []string{}
28+
var (
29+
managementCommands = []string{"ecs", "scan"}
30+
commands = []string{"bundle", "completion", "install", "merge", "render", "split", "status", "uninstall", "validate"}
31+
)
3032

3133
func main() {
3234
fmt.Println("Walking through docker help to list commands...")
3335
getCommands()
36+
getCommands("buildx")
3437
getCommands("compose")
3538

39+
sort.Strings(managementCommands)
40+
sort.Strings(commands)
41+
3642
fmt.Printf(`
3743
var managementCommands = []string{
3844
"help",
@@ -71,7 +77,9 @@ func getCommands(execCommands ...string) {
7177
section = commandsSection
7278
if len(execCommands) > 0 {
7379
command := execCommands[len(execCommands)-1]
74-
managementCommands = append(managementCommands, command)
80+
if !utils.StringContains(managementCommands, command) {
81+
managementCommands = append(managementCommands, command)
82+
}
7583
}
7684
continue
7785
}

0 commit comments

Comments
 (0)