@@ -35,11 +35,12 @@ type execOpts struct {
35
35
environment []string
36
36
workingDir string
37
37
38
- noTty bool
39
- user string
40
- detach bool
41
- index int
42
- privileged bool
38
+ noTty bool
39
+ user string
40
+ detach bool
41
+ index int
42
+ privileged bool
43
+ interactive bool
43
44
}
44
45
45
46
func execCommand (p * projectOptions , dockerCli command.Cli , backend api.Service ) * cobra.Command {
@@ -71,7 +72,7 @@ func execCommand(p *projectOptions, dockerCli command.Cli, backend api.Service)
71
72
runCmd .Flags ().BoolVarP (& opts .noTty , "no-TTY" , "T" , ! dockerCli .Out ().IsTerminal (), "Disable pseudo-TTY allocation. By default `docker compose exec` allocates a TTY." )
72
73
runCmd .Flags ().StringVarP (& opts .workingDir , "workdir" , "w" , "" , "Path to workdir directory for this command." )
73
74
74
- runCmd .Flags ().BoolP ( "interactive" , "i" , true , "Keep STDIN open even if not attached." )
75
+ runCmd .Flags ().BoolVarP ( & opts . interactive , "interactive" , "i" , true , "Keep STDIN open even if not attached." )
75
76
runCmd .Flags ().MarkHidden ("interactive" ) //nolint:errcheck
76
77
runCmd .Flags ().BoolP ("tty" , "t" , true , "Allocate a pseudo-TTY." )
77
78
runCmd .Flags ().MarkHidden ("tty" ) //nolint:errcheck
@@ -103,6 +104,7 @@ func runExec(ctx context.Context, backend api.Service, opts execOpts) error {
103
104
Index : opts .index ,
104
105
Detach : opts .detach ,
105
106
WorkingDir : opts .workingDir ,
107
+ Interactive : opts .interactive ,
106
108
}
107
109
108
110
exitCode , err := backend .Exec (ctx , projectName , execOpts )
0 commit comments