@@ -42,21 +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
59
- navigationMenu 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
60
61
}
61
62
62
63
func (opts upOptions ) apply (project * types.Project , services []string ) (* types.Project , error ) {
@@ -88,6 +89,7 @@ func upCommand(p *ProjectOptions, dockerCli command.Cli, backend api.Service, ex
88
89
PreRunE : AdaptCmd (func (ctx context.Context , cmd * cobra.Command , args []string ) error {
89
90
create .pullChanged = cmd .Flags ().Changed ("pull" )
90
91
create .timeChanged = cmd .Flags ().Changed ("timeout" )
92
+ up .navigationMenuChanged = cmd .Flags ().Changed ("menu" )
91
93
return validateFlags (& up , & create )
92
94
}),
93
95
RunE : p .WithServices (dockerCli , func (ctx context.Context , project * types.Project , services []string ) error {
@@ -129,11 +131,8 @@ func upCommand(p *ProjectOptions, dockerCli command.Cli, backend api.Service, ex
129
131
flags .BoolVar (& up .wait , "wait" , false , "Wait for services to be running|healthy. Implies detached mode." )
130
132
flags .IntVar (& up .waitTimeout , "wait-timeout" , 0 , "Maximum duration to wait for the project to be running|healthy" )
131
133
flags .BoolVarP (& up .watch , "watch" , "w" , false , "Watch source code and rebuild/refresh containers when files are updated." )
132
- composeMenu := true
133
- if os .Getenv (ComposeMenu ) != "" {
134
- composeMenu = utils .StringToBool (os .Getenv (ComposeMenu ))
135
- }
136
- flags .BoolVar (& up .navigationMenu , "navigation-menu" , composeMenu , "While running in attach mode, enable shortcuts and shortcuts info bar." )
134
+ flags .BoolVar (& up .navigationMenu , "menu" , false , "Enable interactive shortcuts when running attached (Experimental). Incompatible with --detach." )
135
+ flags .MarkHidden ("menu" ) //nolint:errcheck
137
136
138
137
return upCmd
139
138
}
@@ -167,7 +166,7 @@ func runUp(
167
166
ctx context.Context ,
168
167
dockerCli command.Cli ,
169
168
backend api.Service ,
170
- _ * experimental.State ,
169
+ experimentals * experimental.State ,
171
170
createOptions createOptions ,
172
171
upOptions upOptions ,
173
172
buildOptions buildOptions ,
@@ -187,6 +186,9 @@ func runUp(
187
186
if err != nil {
188
187
return err
189
188
}
189
+ if ! upOptions .navigationMenuChanged {
190
+ upOptions .navigationMenu = SetUnchangedOption (ComposeMenu , experimentals .NavBar ())
191
+ }
190
192
191
193
var build * api.BuildOptions
192
194
if ! createOptions .noBuild {
@@ -259,16 +261,16 @@ func runUp(
259
261
return backend .Up (ctx , project , api.UpOptions {
260
262
Create : create ,
261
263
Start : api.StartOptions {
262
- Project : project ,
263
- Attach : consumer ,
264
- AttachTo : attach ,
265
- ExitCodeFrom : upOptions .exitCodeFrom ,
266
- CascadeStop : upOptions .cascadeStop ,
267
- Wait : upOptions .wait ,
268
- WaitTimeout : timeout ,
269
- Watch : upOptions .watch ,
270
- Services : services ,
271
- NavigationBar : upOptions .navigationMenu ,
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 ,
272
274
},
273
275
})
274
276
}
0 commit comments