summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-07-23 10:00:11 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-07-23 17:02:12 +0000
commit2c11e38b24942a18f43cb27d6c5145850a40be54 (patch)
treea4d06f2248c1780e4bbcdf5512a88cf21b4be33b /cmd/podman
parent8f48e60840123825d88fd5f50f435f9615cc2948 (diff)
downloadpodman-2c11e38b24942a18f43cb27d6c5145850a40be54.tar.gz
podman-2c11e38b24942a18f43cb27d6c5145850a40be54.tar.bz2
podman-2c11e38b24942a18f43cb27d6c5145850a40be54.zip
Add format descriptors infor to podman top
Trying to play with podman top, I had a hard time finding info on format options. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #1134 Approved by: umohnani8
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/top.go15
1 files changed, 13 insertions, 2 deletions
diff --git a/cmd/podman/top.go b/cmd/podman/top.go
index 749d97505..ab29df3ab 100644
--- a/cmd/podman/top.go
+++ b/cmd/podman/top.go
@@ -12,6 +12,16 @@ import (
"github.com/urfave/cli"
)
+func getDescriptorString() string {
+ descriptors, err := libpod.GetContainerPidInformationDescriptors()
+ if err == nil {
+ return fmt.Sprintf(`
+Format Descriptors:
+%s`, strings.Join(descriptors, ","))
+ }
+ return ""
+}
+
var (
topFlags = []cli.Flag{
LatestFlag,
@@ -20,11 +30,12 @@ var (
Hidden: true,
},
}
- topDescription = `Display the running processes of the container. Specify format descriptors
+ topDescription = fmt.Sprintf(`Display the running processes of the container. Specify format descriptors
to alter the output. You may run "podman top -l pid pcpu seccomp" to print
the process ID, the CPU percentage and the seccomp mode of each process of
the latest container.
-`
+%s
+`, getDescriptorString())
topCommand = cli.Command{
Name: "top",