diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2018-10-29 15:17:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-29 15:17:13 -0700 |
commit | a1b961af50495e2887472c8ecc8383414441c6de (patch) | |
tree | 2bcf3cba1ce8d771f1325736b371d10e7460690f /cmd/podman | |
parent | 7052c8534e7840d928ad0ce664b905262a160106 (diff) | |
parent | 058f0e36818bbb6420e21966507b1b933b5a4e41 (diff) | |
download | podman-a1b961af50495e2887472c8ecc8383414441c6de.tar.gz podman-a1b961af50495e2887472c8ecc8383414441c6de.tar.bz2 podman-a1b961af50495e2887472c8ecc8383414441c6de.zip |
Merge pull request #1724 from baude/psformatchanges
make various changes to ps output
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/ps.go | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/cmd/podman/ps.go b/cmd/podman/ps.go index 00620b95b..83274c9a8 100644 --- a/cmd/podman/ps.go +++ b/cmd/podman/ps.go @@ -334,11 +334,7 @@ func psCmd(c *cli.Context) error { // Output standard PS headers if !opts.Namespace { - fmt.Fprintf(w, "\n%s\t%s\t%s\t%s\t%s\t%s\t%s", hid, himage, hcommand, hcreated, hstatus, hports, hnames) - // If the user does not want size OR pod info, we print the isInfra bool - if !opts.Size && !opts.Pod { - fmt.Fprintf(w, "\t%s", hinfra) - } + fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s\t%s", hid, himage, hcommand, hcreated, hstatus, hports, hnames) // User wants pod info if opts.Pod { fmt.Fprintf(w, "\t%s", hpod) @@ -349,22 +345,15 @@ func psCmd(c *cli.Context) error { } } else { // Output Namespace headers - fmt.Fprintf(w, "\n%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s", hid, hnames, nspid, nscgroup, nsipc, nsmnt, nsnet, nspidns, nsuserns, nsuts) - } - if len(pss) == 0 { - fmt.Fprint(w, "\n") + fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s", hid, hnames, nspid, nscgroup, nsipc, nsmnt, nsnet, nspidns, nsuserns, nsuts) } + // Now iterate each container and output its information for _, container := range pss { // Standard PS output if !opts.Namespace { fmt.Fprintf(w, "\n%s\t%s\t%s\t%s\t%s\t%s\t%s", container.ID, container.Image, container.Command, container.Created, container.Status, container.Ports, container.Names) - - // If not size and not pod info, do isInfra - if !opts.Size && !opts.Pod { - fmt.Fprintf(w, "\t%t", container.IsInfra) - } // User wants pod info if opts.Pod { fmt.Fprintf(w, "\t%s", container.Pod) @@ -387,6 +376,7 @@ func psCmd(c *cli.Context) error { } } + fmt.Fprint(w, "\n") return nil } |