summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorPaul Holzinger <paul.holzinger@web.de>2020-07-05 15:39:34 +0200
committerPaul Holzinger <paul.holzinger@web.de>2020-07-05 18:14:04 +0200
commitb3dd42a7977bef2ea3408857200edde61abf25b7 (patch)
tree29b6ba9b82c036f300c31902b6e959c56f0fd95e /cmd
parentb9d48a95a1c5daf2bb473df7f11c5df715389619 (diff)
downloadpodman-b3dd42a7977bef2ea3408857200edde61abf25b7.tar.gz
podman-b3dd42a7977bef2ea3408857200edde61abf25b7.tar.bz2
podman-b3dd42a7977bef2ea3408857200edde61abf25b7.zip
podman ps truncate the command
With a long create command the output from ps is basically unreadable. This is a regression that was introduced with Podman 2.0. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/containers/ps.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmd/podman/containers/ps.go b/cmd/podman/containers/ps.go
index d10cda609..188a8c03b 100644
--- a/cmd/podman/containers/ps.go
+++ b/cmd/podman/containers/ps.go
@@ -309,7 +309,13 @@ func (l psReporter) Status() string {
// Command returns the container command in string format
func (l psReporter) Command() string {
- return strings.Join(l.ListContainer.Command, " ")
+ command := strings.Join(l.ListContainer.Command, " ")
+ if !noTrunc {
+ if len(command) > 17 {
+ return command[0:17] + "..."
+ }
+ }
+ return command
}
// Size returns the rootfs and virtual sizes in human duration in