Skip to content

Commit 00d5680

Browse files
committed
fix(roles): truncate long descriptions in list output
1 parent baf7f3c commit 00d5680

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

riocli/role/list.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,17 @@ def _display_role_list(
110110
if show_header:
111111
headers = ["Role Name", "Description"]
112112

113-
data = [[r.metadata.name, getattr(r.spec, "description", "")] for r in roles]
113+
data = []
114+
for r in roles:
115+
description = getattr(r.spec, "description", "")
116+
117+
description = description.replace("\n", " ")
118+
if len(description) > 48:
119+
description = description[:48] + ".."
120+
121+
data.append(
122+
[r.metadata.name, description]
123+
)
114124

115125
tabulate_data(data, headers)
116126

0 commit comments

Comments
 (0)