mirror of
https://github.com/nishiki/manage-password.git
synced 2025-02-18 17:10:04 +00:00
minor change when list items
This commit is contained in:
parent
e068a2758c
commit
2ff967cded
1 changed files with 13 additions and 1 deletions
|
@ -147,11 +147,23 @@ class Cli
|
||||||
case result.length
|
case result.length
|
||||||
when 0
|
when 0
|
||||||
puts I18n.t('display.nothing')
|
puts I18n.t('display.nothing')
|
||||||
|
|
||||||
when 1
|
when 1
|
||||||
display_item(result.first)
|
display_item(result.first)
|
||||||
|
|
||||||
else
|
else
|
||||||
|
group = nil
|
||||||
i = 1
|
i = 1
|
||||||
|
|
||||||
|
result.sort! { |a,b| a.group.downcase <=> b.group.downcase }
|
||||||
|
|
||||||
result.each do |item|
|
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 "#{i}: ".cyan
|
||||||
print item.name
|
print item.name
|
||||||
print " -> #{item.comment}".magenta if not item.comment.to_s.empty?
|
print " -> #{item.comment}".magenta if not item.comment.to_s.empty?
|
||||||
|
|
Loading…
Add table
Reference in a new issue