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

Add --no-labels option to ghi-list #280

Merged
merged 1 commit into from
Apr 8, 2016
Merged
Show file tree
Hide file tree
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
12 changes: 8 additions & 4 deletions ghi
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ module GHI
(i['repo'].to_s.rjust(rmax) if i['repo']),
format_number(n.to_s.rjust(nmax)),
truncate(title, l),
format_labels(labels),
(format_labels(labels) unless assigns[:dont_print_labels]),
(fg(:green) { m['title'] } if m),
(fg('aaaaaa') { c } unless c == 0),
(fg('aaaaaa') { '↑' } if p),
Expand Down Expand Up @@ -953,8 +953,8 @@ EOF
def format_comment_editor issue, comment = nil
message = ERB.new(<<EOF).result binding

Leave a comment. Trailing lines starting with '#' (like these) will be ignored,
and empty messages will not be submitted. Comments are formatted with GitHub
Leave a comment. Trailing lines starting with '#' (like these) will be ignored,
and empty messages will not be submitted. Comments are formatted with GitHub
Flavored Markdown (GFM):

http://github.github.com/github-flavored-markdown
Expand Down Expand Up @@ -2386,7 +2386,6 @@ module GHI
attr_accessor :pull_requests_only

def options

OptionParser.new do |opts|
opts.banner = 'usage: ghi list [options]'
opts.separator ''
Expand All @@ -2410,6 +2409,11 @@ module GHI
) do |labels|
(assigns[:exclude_labels] ||= []).concat labels
end
opts.on(
'--no-labels', 'do not print labels'
) do
assigns[:dont_print_labels] = true
end
opts.on(
'-S', '--sort <by>', %w(created updated comments),
{'c'=>'created','u'=>'updated','m'=>'comments'},
Expand Down
5 changes: 5 additions & 0 deletions lib/ghi/commands/list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ def options
) do |labels|
(assigns[:exclude_labels] ||= []).concat labels
end
opts.on(
'--no-labels', 'do not print labels'
) do
assigns[:dont_print_labels] = true
end
opts.on(
'-S', '--sort <by>', %w(created updated comments),
{'c'=>'created','u'=>'updated','m'=>'comments'},
Expand Down
6 changes: 3 additions & 3 deletions lib/ghi/formatting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def format_issues issues, include_repo
(i['repo'].to_s.rjust(rmax) if i['repo']),
format_number(n.to_s.rjust(nmax)),
truncate(title, l),
format_labels(labels),
(format_labels(labels) unless assigns[:dont_print_labels]),
(fg(:green) { m['title'] } if m),
(fg('aaaaaa') { c } unless c == 0),
(fg('aaaaaa') { '↑' } if p),
Expand Down Expand Up @@ -413,8 +413,8 @@ def format_milestone_editor milestone = nil
def format_comment_editor issue, comment = nil
message = ERB.new(<<EOF).result binding

Leave a comment. Trailing lines starting with '#' (like these) will be ignored,
and empty messages will not be submitted. Comments are formatted with GitHub
Leave a comment. Trailing lines starting with '#' (like these) will be ignored,
and empty messages will not be submitted. Comments are formatted with GitHub
Flavored Markdown (GFM):

http://github.github.com/github-flavored-markdown
Expand Down