@@ -42,20 +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
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
5961}
6062
6163func (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
8789 PreRunE : AdaptCmd (func (ctx context.Context , cmd * cobra.Command , args []string ) error {
8890 create .pullChanged = cmd .Flags ().Changed ("pull" )
8991 create .timeChanged = cmd .Flags ().Changed ("timeout" )
92+ up .navigationMenuChanged = cmd .Flags ().Changed ("menu" )
9093 return validateFlags (& up , & create )
9194 }),
9295 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
128131 flags .BoolVar (& up .wait , "wait" , false , "Wait for services to be running|healthy. Implies detached mode." )
129132 flags .IntVar (& up .waitTimeout , "wait-timeout" , 0 , "Maximum duration to wait for the project to be running|healthy" )
130133 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
131136
132137 return upCmd
133138}
@@ -161,7 +166,7 @@ func runUp(
161166 ctx context.Context ,
162167 dockerCli command.Cli ,
163168 backend api.Service ,
164- _ * experimental.State ,
169+ experimentals * experimental.State ,
165170 createOptions createOptions ,
166171 upOptions upOptions ,
167172 buildOptions buildOptions ,
@@ -181,6 +186,9 @@ func runUp(
181186 if err != nil {
182187 return err
183188 }
189+ if ! upOptions .navigationMenuChanged {
190+ upOptions .navigationMenu = SetUnchangedOption (ComposeMenu , experimentals .NavBar ())
191+ }
184192
185193 var build * api.BuildOptions
186194 if ! createOptions .noBuild {
@@ -253,15 +261,16 @@ func runUp(
253261 return backend .Up (ctx , project , api.UpOptions {
254262 Create : create ,
255263 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 ,
265274 },
266275 })
267276}
0 commit comments