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

Commit

Permalink
Merge pull request #280 from davidcelis/no-labels
Browse files Browse the repository at this point in the history
Add --no-labels option to `ghi-list`
  • Loading branch information
stephencelis committed Apr 8, 2016
2 parents 40327ab + 5088b5d commit 01ac0ce
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
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

0 comments on commit 01ac0ce

Please sign in to comment.