Skip to content

Commit c64b044

Browse files
authored
Merge pull request docker#9229 from ulyssessouza/add-ti-run-exec
Add -i and -t to run and exec
2 parents 1a4e6c2 + 61735c0 commit c64b044

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

cmd/compose/exec.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ func execCommand(p *projectOptions, backend api.Service) *cobra.Command {
7373
runCmd.Flags().BoolVarP(&opts.noTty, "no-TTY", "T", false, "Disable pseudo-TTY allocation. By default `docker compose exec` allocates a TTY.")
7474
runCmd.Flags().StringVarP(&opts.workingDir, "workdir", "w", "", "Path to workdir directory for this command.")
7575

76+
runCmd.Flags().BoolP("interactive", "i", true, "Keep STDIN open even if not attached. DEPRECATED")
77+
runCmd.Flags().MarkHidden("interactive") //nolint:errcheck
78+
runCmd.Flags().BoolP("tty", "t", true, "Allocate a pseudo-TTY. DEPRECATED")
79+
runCmd.Flags().MarkHidden("tty") //nolint:errcheck
80+
7681
runCmd.Flags().SetInterspersed(false)
7782
return runCmd
7883
}

cmd/compose/run.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ func runCommand(p *projectOptions, backend api.Service) *cobra.Command {
155155
flags.BoolVar(&opts.servicePorts, "service-ports", false, "Run command with the service's ports enabled and mapped to the host.")
156156
flags.BoolVar(&opts.quietPull, "quiet-pull", false, "Pull without printing progress information.")
157157

158+
cmd.Flags().BoolP("interactive", "i", true, "Keep STDIN open even if not attached. DEPRECATED")
159+
cmd.Flags().MarkHidden("interactive") //nolint:errcheck
160+
cmd.Flags().BoolP("tty", "t", true, "Allocate a pseudo-TTY. DEPRECATED")
161+
cmd.Flags().MarkHidden("tty") //nolint:errcheck
162+
158163
flags.SetNormalizeFunc(normalizeRunFlags)
159164
flags.SetInterspersed(false)
160165
return cmd

0 commit comments

Comments
 (0)