1
0
Fork 0
mirror of https://github.com/nishiki/manage-password.git synced 2024-11-26 23:33:03 +00:00

minor change when list items

This commit is contained in:
nishiki 2016-07-09 17:11:18 +02:00
parent e068a2758c
commit 2ff967cded

View file

@ -147,11 +147,23 @@ class Cli
case result.length
when 0
puts I18n.t('display.nothing')
when 1
display_item(result.first)
else
group = nil
i = 1
result.sort! { |a,b| a.group.downcase <=> b.group.downcase }
result.each do |item|
if group != item.group
group = item.group
puts "#{I18n.t('display.group')}: #{group}".yellow
end
print " |_ ".yellow
print "#{i}: ".cyan
print item.name
print " -> #{item.comment}".magenta if not item.comment.to_s.empty?