summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorPaul Holzinger <paul.holzinger@web.de>2020-07-05 15:39:34 +0200
committerMatthew Heon <matthew.heon@pm.me>2020-07-06 13:07:29 -0400
commit0e547a4cc3c8c49053338ea73c02be708257c3d9 (patch)
tree3a2286077c5b90a605e710993879592b95dc1a87 /cmd
parent1a60550bef976a57777c75e055ad35ff8cf87f23 (diff)
downloadpodman-0e547a4cc3c8c49053338ea73c02be708257c3d9.tar.gz
podman-0e547a4cc3c8c49053338ea73c02be708257c3d9.tar.bz2
podman-0e547a4cc3c8c49053338ea73c02be708257c3d9.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 5cd7f40ac..24266244e 100644
--- a/cmd/podman/containers/ps.go
+++ b/cmd/podman/containers/ps.go
@@ -313,7 +313,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