aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-04-18 15:36:36 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-04-19 16:56:29 +0000
commit2cf78a2006200253d6763bf111204476cd0c3c82 (patch)
tree04798cadf615f147d26b94a321344874db6b6259 /cmd
parentf2658ecda25cbc83d09256d9e8f99560433d2595 (diff)
downloadpodman-2cf78a2006200253d6763bf111204476cd0c3c82.tar.gz
podman-2cf78a2006200253d6763bf111204476cd0c3c82.tar.bz2
podman-2cf78a2006200253d6763bf111204476cd0c3c82.zip
Print ctr ID if neither STDOUT and STDERR are attached
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #638 Approved by: rhatdan
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/utils.go5
1 files changed, 5 insertions, 0 deletions
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())