From 984dfecb2c1293062edf4cbb77a2b4e115c81fd5 Mon Sep 17 00:00:00 2001 From: baude Date: Thu, 8 Mar 2018 13:04:44 -0600 Subject: podman ps command string too long The default outout for podman ps should limit itself if the command is long. If the command is more than 20 characters, we truncate the command and add an elipses to it. Resolves: #464 Signed-off-by: baude Closes: #466 Approved by: rhatdan --- cmd/podman/ps.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cmd') diff --git a/cmd/podman/ps.go b/cmd/podman/ps.go index 14da06ae8..26991af4b 100644 --- a/cmd/podman/ps.go +++ b/cmd/podman/ps.go @@ -435,6 +435,11 @@ func getTemplateOutput(containers []*libpod.Container, opts psOptions) ([]psTemp } command := strings.Join(batchInfo.conConfig.Spec.Process.Args, " ") + if !opts.noTrunc { + if len(command) > 20 { + command = command[:19] + "..." + } + } ports := portsToString(batchInfo.conConfig.PortMappings) mounts := getMounts(createArtifact.Volumes, opts.noTrunc) labels := formatLabels(ctr.Labels()) @@ -471,6 +476,7 @@ func getTemplateOutput(containers []*libpod.Container, opts psOptions) ([]psTemp Mounts: mounts, PID: batchInfo.pid, } + if opts.namespace { params.Cgroup = ns.Cgroup params.IPC = ns.IPC -- cgit v1.2.3-54-g00ecf