Add ability to add ot exclude issues wothout any labels

This commit is contained in:
Petr Korolev
2014-11-10 15:32:06 +02:00
parent fc96007741
commit f08685b015
2 changed files with 21 additions and 8 deletions
+5 -2
View File
@@ -3,7 +3,7 @@ require 'optparse'
class Parser
def self.parse_options
options = {:tag1 => nil, :tag2 => nil, :format => '%d/%m/%y', :output => 'CHANGELOG.md', :labels => %w(bug enhancement), :pulls => true, :issues => true, :verbose => true}
options = {:tag1 => nil, :tag2 => nil, :format => '%d/%m/%y', :output => 'CHANGELOG.md', :labels => %w(bug enhancement), :pulls => true, :issues => true, :verbose => true, :add_issues_wo_labels => true }
parser = OptionParser.new { |opts|
opts.banner = 'Usage: changelog_generator [options]'
@@ -20,12 +20,15 @@ class Parser
puts opts
exit
end
opts.on('-v', '--[no-]verbose', 'Run verbosely') do |v|
opts.on('-v', '--[no-]verbose', 'Run verbosely. Default is true') do |v|
options[:verbose] = v
end
opts.on('--[no-]issues', 'Include closed issues to changelog. Default is true') do |v|
options[:issues] = v
end
opts.on('--[no-]issues-without-labels', 'Include closed issues without any labels to changelog. Default is true') do |v|
options[:add_issues_wo_labels] = v
end
opts.on('--[no-]pull-requests', 'Include pull-requests to changelog. Default is true') do |v|
options[:pulls] = v
end