mirror of
https://github.com/docker/compose.git
synced 2025-07-23 05:34:36 +02:00
pass interactive flag to ExecOptions for the RunExec command
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
This commit is contained in:
parent
be187bae64
commit
b7fd6eb7d8
@ -40,6 +40,7 @@ type execOpts struct {
|
|||||||
detach bool
|
detach bool
|
||||||
index int
|
index int
|
||||||
privileged bool
|
privileged bool
|
||||||
|
interactive bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func execCommand(p *projectOptions, dockerCli command.Cli, backend api.Service) *cobra.Command {
|
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)
|
|||||||
runCmd.Flags().BoolVarP(&opts.noTty, "no-TTY", "T", !dockerCli.Out().IsTerminal(), "Disable pseudo-TTY allocation. By default `docker compose exec` allocates a TTY.")
|
runCmd.Flags().BoolVarP(&opts.noTty, "no-TTY", "T", !dockerCli.Out().IsTerminal(), "Disable pseudo-TTY allocation. By default `docker compose exec` allocates a TTY.")
|
||||||
runCmd.Flags().StringVarP(&opts.workingDir, "workdir", "w", "", "Path to workdir directory for this command.")
|
runCmd.Flags().StringVarP(&opts.workingDir, "workdir", "w", "", "Path to workdir directory for this command.")
|
||||||
|
|
||||||
runCmd.Flags().BoolP("interactive", "i", true, "Keep STDIN open even if not attached.")
|
runCmd.Flags().BoolVarP(&opts.interactive, "interactive", "i", true, "Keep STDIN open even if not attached.")
|
||||||
runCmd.Flags().MarkHidden("interactive") //nolint:errcheck
|
runCmd.Flags().MarkHidden("interactive") //nolint:errcheck
|
||||||
runCmd.Flags().BoolP("tty", "t", true, "Allocate a pseudo-TTY.")
|
runCmd.Flags().BoolP("tty", "t", true, "Allocate a pseudo-TTY.")
|
||||||
runCmd.Flags().MarkHidden("tty") //nolint:errcheck
|
runCmd.Flags().MarkHidden("tty") //nolint:errcheck
|
||||||
@ -103,6 +104,7 @@ func runExec(ctx context.Context, backend api.Service, opts execOpts) error {
|
|||||||
Index: opts.index,
|
Index: opts.index,
|
||||||
Detach: opts.detach,
|
Detach: opts.detach,
|
||||||
WorkingDir: opts.workingDir,
|
WorkingDir: opts.workingDir,
|
||||||
|
Interactive: opts.interactive,
|
||||||
}
|
}
|
||||||
|
|
||||||
exitCode, err := backend.Exec(ctx, projectName, execOpts)
|
exitCode, err := backend.Exec(ctx, projectName, execOpts)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user