aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-07-06 09:33:23 -0400
committerGitHub <noreply@github.com>2020-07-06 09:33:23 -0400
commit262843e1ce22575483f66fcd17a237202eaa3108 (patch)
tree12f08ed03d0259d9b360223e73ca2a4d4a306b90 /cmd
parent9bccb0f091a82656593a069891f143e78a8719e9 (diff)
parentb3dd42a7977bef2ea3408857200edde61abf25b7 (diff)
downloadpodman-262843e1ce22575483f66fcd17a237202eaa3108.tar.gz
podman-262843e1ce22575483f66fcd17a237202eaa3108.tar.bz2
podman-262843e1ce22575483f66fcd17a237202eaa3108.zip
Merge pull request #6855 from Luap99/ps-command-trunc
podman ps truncate the command
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