From c4f5ed839fb44b2d057389efa599d2f30938bd3e Mon Sep 17 00:00:00 2001 From: Ben Firshman Date: Thu, 16 Jan 2014 14:02:52 +0000 Subject: [PATCH 1/2] Shorten long commands in ps --- fig/cli/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fig/cli/main.py b/fig/cli/main.py index cd4476f4a..0993510d7 100644 --- a/fig/cli/main.py +++ b/fig/cli/main.py @@ -156,9 +156,12 @@ class TopLevelCommand(Command): ] rows = [] for container in containers: + command = container.human_readable_command + if len(command) > 30: + command = '%s ...' % command[:30] rows.append([ container.name, - container.human_readable_command, + command, container.human_readable_state, container.human_readable_ports, ]) From af1b0ed08895fa13ca46ef417c975e07f8391b08 Mon Sep 17 00:00:00 2001 From: Aanand Prasad Date: Thu, 16 Jan 2014 14:06:48 +0000 Subject: [PATCH 2/2] Account for length of the ellipsis string when truncating commands --- fig/cli/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fig/cli/main.py b/fig/cli/main.py index 0993510d7..24a0180d9 100644 --- a/fig/cli/main.py +++ b/fig/cli/main.py @@ -158,7 +158,7 @@ class TopLevelCommand(Command): for container in containers: command = container.human_readable_command if len(command) > 30: - command = '%s ...' % command[:30] + command = '%s ...' % command[:26] rows.append([ container.name, command,