From 2cf78a2006200253d6763bf111204476cd0c3c82 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Wed, 18 Apr 2018 15:36:36 -0400 Subject: Print ctr ID if neither STDOUT and STDERR are attached Signed-off-by: Matthew Heon Closes: #638 Approved by: rhatdan --- cmd/podman/utils.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cmd') diff --git a/cmd/podman/utils.go b/cmd/podman/utils.go index bcf4734a9..cf0047db9 100644 --- a/cmd/podman/utils.go +++ b/cmd/podman/utils.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "os" gosignal "os/signal" @@ -170,6 +171,10 @@ func startAttachCtr(ctr *libpod.Container, stdout, stderr, stdin *os.File, detac ProxySignals(ctr) } + if stdout == nil && stderr == nil { + fmt.Printf("%s\n", ctr.ID()) + } + err = <-attachChan if err != nil { return errors.Wrapf(err, "error attaching to container %s", ctr.ID()) -- cgit v1.2.3-54-g00ecf