@@ -42,21 +42,22 @@ type composeOptions struct {
4242
4343type upOptions struct {
4444 * 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
6061}
6162
6263func (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
8889 PreRunE : AdaptCmd (func (ctx context.Context , cmd * cobra.Command , args []string ) error {
8990 create .pullChanged = cmd .Flags ().Changed ("pull" )
9091 create .timeChanged = cmd .Flags ().Changed ("timeout" )
92+ up .navigationMenuChanged = cmd .Flags ().Changed ("menu" )
9193 return validateFlags (& up , & create )
9294 }),
9395 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
129131 flags .BoolVar (& up .wait , "wait" , false , "Wait for services to be running|healthy. Implies detached mode." )
130132 flags .IntVar (& up .waitTimeout , "wait-timeout" , 0 , "Maximum duration to wait for the project to be running|healthy" )
131133 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
137136
138137 return upCmd
139138}
@@ -167,7 +166,7 @@ func runUp(
167166 ctx context.Context ,
168167 dockerCli command.Cli ,
169168 backend api.Service ,
170- _ * experimental.State ,
169+ experimentals * experimental.State ,
171170 createOptions createOptions ,
172171 upOptions upOptions ,
173172 buildOptions buildOptions ,
@@ -187,6 +186,9 @@ func runUp(
187186 if err != nil {
188187 return err
189188 }
189+ if ! upOptions .navigationMenuChanged {
190+ upOptions .navigationMenu = SetUnchangedOption (ComposeMenu , experimentals .NavBar ())
191+ }
190192
191193 var build * api.BuildOptions
192194 if ! createOptions .noBuild {
@@ -259,16 +261,16 @@ func runUp(
259261 return backend .Up (ctx , project , api.UpOptions {
260262 Create : create ,
261263 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 ,
272274 },
273275 })
274276}
0 commit comments