Skip to content

Commit 3dd9b03

Browse files
committed
get: print comment # aligned to the right
With this change and preceding real name and date/time changes a comment header gets as close to the WebUI as possible.
1 parent f68ed84 commit 3dd9b03

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

bugz/cli.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,15 @@ def show_bug_info(bug, settings):
329329
else:
330330
who = comment['creator']
331331
when = parsetime(comment['time'])
332-
what = comment['text']
333-
print('[Comment #%d] %s %s' % (i, who, printtime(when, settings)))
332+
header_left = '%s %s' % (who, printtime(when, settings))
333+
header_right = '[Comment %d]' % i
334+
space = settings.columns - len(header_left) - len(header_right) - 3
335+
if space < 0:
336+
space = 0
337+
print(header_left, ' ' * space, header_right)
334338
print('-' * (settings.columns - 1))
335339

340+
what = comment['text']
336341
if what is None:
337342
what = ''
338343

0 commit comments

Comments
 (0)