This repository was archived by the owner on Nov 27, 2023. It is now read-only.
File tree 3 files changed +20
-34
lines changed
3 files changed +20
-34
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ var commandFlags = []string{
26
26
// Generated with generatecommands/main.go
27
27
var managementCommands = []string {
28
28
"help" ,
29
+ "alpha" ,
29
30
"app" ,
30
31
"builder" ,
31
32
"buildx" ,
@@ -160,4 +161,5 @@ var commands = []string{
160
161
"validate" ,
161
162
"version" ,
162
163
"wait" ,
164
+ "watch" ,
163
165
}
Original file line number Diff line number Diff line change @@ -68,6 +68,11 @@ func NewDockerCLIEvent(cmd CmdResult) *DockerCLIEvent {
68
68
subcommand = strings .Join (subcommandParts , "-" )
69
69
}
70
70
71
+ cmdOrPlugin := cmdPath [1 ]
72
+ if cmdOrPlugin .plugin && subcommand == "" {
73
+ return nil
74
+ }
75
+
71
76
var usage bool
72
77
for _ , arg := range cmd .Args {
73
78
// TODO(milas): also support `docker help build` syntax
@@ -81,7 +86,7 @@ func NewDockerCLIEvent(cmd CmdResult) *DockerCLIEvent {
81
86
}
82
87
83
88
event := & DockerCLIEvent {
84
- Command : cmdPath [ 1 ] .name ,
89
+ Command : cmdOrPlugin .name ,
85
90
Subcommand : subcommand ,
86
91
ExitCode : int32 (cmd .ExitCode ),
87
92
Usage : usage ,
@@ -161,32 +166,6 @@ var cmdHierarchy = &cmdNode{
161
166
{name : "dryrun" },
162
167
},
163
168
},
164
- {name : "build" },
165
- {name : "config" },
166
- {name : "convert" },
167
- {name : "cp" },
168
- {name : "create" },
169
- {name : "down" },
170
- {name : "events" },
171
- {name : "exec" },
172
- {name : "images" },
173
- {name : "kill" },
174
- {name : "logs" },
175
- {name : "ls" },
176
- {name : "pause" },
177
- {name : "port" },
178
- {name : "ps" },
179
- {name : "pull" },
180
- {name : "push" },
181
- {name : "restart" },
182
- {name : "rm" },
183
- {name : "run" },
184
- {name : "start" },
185
- {name : "stop" },
186
- {name : "top" },
187
- {name : "unpause" },
188
- {name : "up" },
189
- {name : "version" },
190
169
},
191
170
},
192
171
},
Original file line number Diff line number Diff line change @@ -43,30 +43,35 @@ func TestCmdCompose(t *testing.T) {
43
43
{
44
44
name : "Compose - Base" ,
45
45
input : "docker compose" ,
46
- expected : & DockerCLIEvent {Command : "compose" },
46
+ expected : nil ,
47
+ },
48
+ {
49
+ name : "Compose - Ignored" ,
50
+ input : "docker compose up" ,
51
+ expected : nil ,
47
52
},
48
53
{
49
54
name : "Compose - Root Args" ,
50
- input : "docker --host 127.0.0.1 --debug=true compose ls " ,
55
+ input : "docker --host 127.0.0.1 --debug=true compose alpha watch " ,
51
56
expected : & DockerCLIEvent {
52
57
Command : "compose" ,
53
- Subcommand : "ls " ,
58
+ Subcommand : "alpha-watch " ,
54
59
},
55
60
},
56
61
{
57
62
name : "Compose - Base Args" ,
58
- input : "docker compose -p myproject build myservice" ,
63
+ input : "docker compose -p myproject alpha watch myservice" ,
59
64
expected : & DockerCLIEvent {
60
65
Command : "compose" ,
61
- Subcommand : "build " ,
66
+ Subcommand : "alpha-watch " ,
62
67
},
63
68
},
64
69
{
65
70
name : "Compose - Usage" ,
66
- input : "docker compose --file=mycompose.yaml up --help myservice" ,
71
+ input : "docker compose --file=mycompose.yaml alpha watch --help myservice" ,
67
72
expected : & DockerCLIEvent {
68
73
Command : "compose" ,
69
- Subcommand : "up " ,
74
+ Subcommand : "alpha-watch " ,
70
75
Usage : true ,
71
76
},
72
77
},
You can’t perform that action at this time.
0 commit comments