@@ -42,20 +42,22 @@ type composeOptions struct {
42
42
43
43
type upOptions struct {
44
44
* composeOptions
45
- Detach bool
46
- noStart bool
47
- noDeps bool
48
- cascadeStop bool
49
- exitCodeFrom string
50
- noColor bool
51
- noPrefix bool
52
- attachDependencies bool
53
- attach []string
54
- noAttach []string
55
- timestamp bool
56
- wait bool
57
- waitTimeout int
58
- watch bool
45
+ Detach bool
46
+ noStart bool
47
+ noDeps bool
48
+ cascadeStop bool
49
+ exitCodeFrom string
50
+ noColor bool
51
+ noPrefix bool
52
+ attachDependencies bool
53
+ attach []string
54
+ noAttach []string
55
+ timestamp bool
56
+ wait bool
57
+ waitTimeout int
58
+ watch bool
59
+ navigationMenu bool
60
+ navigationMenuChanged bool
59
61
}
60
62
61
63
func (opts upOptions ) apply (project * types.Project , services []string ) (* types.Project , error ) {
@@ -87,6 +89,7 @@ func upCommand(p *ProjectOptions, dockerCli command.Cli, backend api.Service, ex
87
89
PreRunE : AdaptCmd (func (ctx context.Context , cmd * cobra.Command , args []string ) error {
88
90
create .pullChanged = cmd .Flags ().Changed ("pull" )
89
91
create .timeChanged = cmd .Flags ().Changed ("timeout" )
92
+ up .navigationMenuChanged = cmd .Flags ().Changed ("menu" )
90
93
return validateFlags (& up , & create )
91
94
}),
92
95
RunE : p .WithServices (dockerCli , func (ctx context.Context , project * types.Project , services []string ) error {
@@ -128,6 +131,8 @@ func upCommand(p *ProjectOptions, dockerCli command.Cli, backend api.Service, ex
128
131
flags .BoolVar (& up .wait , "wait" , false , "Wait for services to be running|healthy. Implies detached mode." )
129
132
flags .IntVar (& up .waitTimeout , "wait-timeout" , 0 , "Maximum duration to wait for the project to be running|healthy" )
130
133
flags .BoolVarP (& up .watch , "watch" , "w" , false , "Watch source code and rebuild/refresh containers when files are updated." )
134
+ flags .BoolVar (& up .navigationMenu , "menu" , false , "Enable interactive shortcuts when running attached (Experimental). Incompatible with --detach." )
135
+ flags .MarkHidden ("menu" ) //nolint:errcheck
131
136
132
137
return upCmd
133
138
}
@@ -161,7 +166,7 @@ func runUp(
161
166
ctx context.Context ,
162
167
dockerCli command.Cli ,
163
168
backend api.Service ,
164
- _ * experimental.State ,
169
+ experimentals * experimental.State ,
165
170
createOptions createOptions ,
166
171
upOptions upOptions ,
167
172
buildOptions buildOptions ,
@@ -181,6 +186,9 @@ func runUp(
181
186
if err != nil {
182
187
return err
183
188
}
189
+ if ! upOptions .navigationMenuChanged {
190
+ upOptions .navigationMenu = SetUnchangedOption (ComposeMenu , experimentals .NavBar ())
191
+ }
184
192
185
193
var build * api.BuildOptions
186
194
if ! createOptions .noBuild {
@@ -253,15 +261,16 @@ func runUp(
253
261
return backend .Up (ctx , project , api.UpOptions {
254
262
Create : create ,
255
263
Start : api.StartOptions {
256
- Project : project ,
257
- Attach : consumer ,
258
- AttachTo : attach ,
259
- ExitCodeFrom : upOptions .exitCodeFrom ,
260
- CascadeStop : upOptions .cascadeStop ,
261
- Wait : upOptions .wait ,
262
- WaitTimeout : timeout ,
263
- Watch : upOptions .watch ,
264
- Services : services ,
264
+ Project : project ,
265
+ Attach : consumer ,
266
+ AttachTo : attach ,
267
+ ExitCodeFrom : upOptions .exitCodeFrom ,
268
+ CascadeStop : upOptions .cascadeStop ,
269
+ Wait : upOptions .wait ,
270
+ WaitTimeout : timeout ,
271
+ Watch : upOptions .watch ,
272
+ Services : services ,
273
+ NavigationMenu : upOptions .navigationMenu ,
265
274
},
266
275
})
267
276
}
0 commit comments