summaryrefslogtreecommitdiff
path: root/cmd/podman/top.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-05-03 15:16:53 +0200
committerGitHub <noreply@github.com>2019-05-03 15:16:53 +0200
commit0eaba2d56a48c68e1d08e287a1c9eb5405cc743a (patch)
tree29f4b20794d7c69ecebd3f71aa4491a13034b406 /cmd/podman/top.go
parenta7809fabe508e26c527490e700a1703ef923bd3b (diff)
parent0d2d52339058a19e66ecc75f78c52596054c7dad (diff)
downloadpodman-0eaba2d56a48c68e1d08e287a1c9eb5405cc743a.tar.gz
podman-0eaba2d56a48c68e1d08e287a1c9eb5405cc743a.tar.bz2
podman-0eaba2d56a48c68e1d08e287a1c9eb5405cc743a.zip
Merge pull request #3034 from vrothberg/top-fallback
top: fallback to execing ps(1)
Diffstat (limited to 'cmd/podman/top.go')
-rw-r--r--cmd/podman/top.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/cmd/podman/top.go b/cmd/podman/top.go
index 2e0a22d92..8583eccb5 100644
--- a/cmd/podman/top.go
+++ b/cmd/podman/top.go
@@ -33,7 +33,7 @@ var (
%s`, getDescriptorString())
_topCommand = &cobra.Command{
- Use: "top [flags] CONTAINER [FORMAT-DESCRIPTORS]",
+ Use: "top [flags] CONTAINER [FORMAT-DESCRIPTORS|ARGS]",
Short: "Display the running processes of a container",
Long: topDescription,
RunE: func(cmd *cobra.Command, args []string) error {
@@ -42,9 +42,11 @@ var (
topCommand.Remote = remoteclient
return topCmd(&topCommand)
},
+ Args: cobra.ArbitraryArgs,
Example: `podman top ctrID
- podman top --latest
- podman top ctrID pid seccomp args %C`,
+podman top --latest
+podman top ctrID pid seccomp args %C
+podman top ctrID -eo user,pid,comm`,
}
)
@@ -53,6 +55,7 @@ func init() {
topCommand.SetHelpTemplate(HelpTemplate())
topCommand.SetUsageTemplate(UsageTemplate())
flags := topCommand.Flags()
+ flags.SetInterspersed(false)
flags.BoolVar(&topCommand.ListDescriptors, "list-descriptors", false, "")
flags.MarkHidden("list-descriptors")
flags.BoolVarP(&topCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of")