diff options
Diffstat (limited to 'cmd/podman/port.go')
-rw-r--r-- | cmd/podman/port.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/podman/port.go b/cmd/podman/port.go index bcf372a51..ffb5749fb 100644 --- a/cmd/podman/port.go +++ b/cmd/podman/port.go @@ -20,7 +20,7 @@ var ( List port mappings for the CONTAINER, or lookup the public-facing port that is NAT-ed to the PRIVATE_PORT ` _portCommand = &cobra.Command{ - Use: "port", + Use: "port [flags] CONTAINER", Short: "List port mappings or a specific mapping for the container", Long: portDescription, RunE: func(cmd *cobra.Command, args []string) error { @@ -128,9 +128,6 @@ func portCmd(c *cliconfig.PortValues) error { if state, _ := con.State(); state != libpod.ContainerStateRunning { continue } - if c.All { - fmt.Println(con.ID()) - } portmappings, err := con.PortMappings() if err != nil { @@ -143,6 +140,9 @@ func portCmd(c *cliconfig.PortValues) error { if hostIP == "" { hostIP = "0.0.0.0" } + if c.All { + fmt.Printf("%s\t", con.ID()[:12]) + } // If not searching by port or port/proto, then dump what we see if port == "" { fmt.Printf("%d/%s -> %s:%d\n", v.ContainerPort, v.Protocol, hostIP, v.HostPort) |