Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

Add a --verbose option for listing labels #336

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/ghi/commands/label.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def options
usage: ghi label <labelname> [-c <color>] [-r <newname>]
or: ghi label -D <labelname>
or: ghi label <issueno(s)> [-a] [-d] [-f] <label>
or: ghi label -l [<issueno>]
or: ghi label -l [<issueno>] [-v]
EOF
opts.separator ''
opts.on '-l', '--list [<issueno>]', 'list label names' do |n|
Expand All @@ -38,6 +38,9 @@ def options
assigns[:name] = name
self.action = 'update'
end
opts.on '-v', '--verbose', 'show color values for labels' do |v|
self.verbose = true
end
opts.separator ''
opts.separator 'Issue modification options'
opts.on '-a', '--add', 'add labels to issue' do
Expand Down Expand Up @@ -84,6 +87,9 @@ def index
else
puts labels.map { |label|
name = label['name']
if self.verbose
name += " ##{label['color']}"
end
colorize? ? bg(label['color']) { " #{name} " } : name
}
end
Expand Down