rename oprion

This commit is contained in:
Petr Korolev 2015-02-18 21:50:33 +02:00
parent 904017cf4d
commit 9b8291ab69
2 changed files with 5 additions and 5 deletions

View File

@ -504,7 +504,7 @@ module GitHubChangelogGenerator
filtered_issues = issues.select { |issue|
#compare is there any labels from @options[:labels] array
(issue.labels.map { |label| label.name } & @options[:labels]).any?
(issue.labels.map { |label| label.name } & @options[:include_labels]).any?
}
@ -518,7 +518,7 @@ module GitHubChangelogGenerator
if @options[:verbose]
puts "Filtered issues with labels #{@options[:labels]}#{@options[:add_issues_wo_labels] ? ' and w/o labels' : ''}: #{filtered_issues.count}"
puts "Filtered issues with labels #{@options[:include_labels]}#{@options[:add_issues_wo_labels] ? ' and w/o labels' : ''}: #{filtered_issues.count}"
end
filtered_issues

View File

@ -6,7 +6,7 @@ require_relative 'version'
module GitHubChangelogGenerator
class Parser
def self.parse_options
options = {:tag1 => nil, :tag2 => nil, :format => '%Y-%m-%d', :output => 'CHANGELOG.md', :labels => %w(bug enhancement), :pulls => true, :issues => true, :verbose => true, :add_issues_wo_labels => true, :merge_prefix => '*Merged pull-request:* ', :author => true, :pull_request_labels => nil, :filter_issues_by_milestone => true, :compare_link => true, :unreleased => true}
options = {:tag1 => nil, :tag2 => nil, :format => '%Y-%m-%d', :output => 'CHANGELOG.md', :include_labels => %w(bug enhancement), :pulls => true, :issues => true, :verbose => true, :add_issues_wo_labels => true, :merge_prefix => '*Merged pull-request:* ', :author => true, :pull_request_labels => nil, :filter_issues_by_milestone => true, :compare_link => true, :unreleased => true}
parser = OptionParser.new { |opts|
opts.banner = 'Usage: changelog_generator [options]'
@ -52,8 +52,8 @@ module GitHubChangelogGenerator
opts.on('--[no-]compare-link', 'Include compare link between older version and newer version. Default is true') do |v|
options[:compare_link] = v
end
opts.on('--labels x,y,z', Array, 'Issues with that labels will be included to changelog. Default is \'bug,enhancement\'') do |list|
options[:labels] = list
opts.on('--include-labels x,y,z', Array, 'Issues with that labels will be included to changelog. Default is \'bug,enhancement\'') do |list|
options[:include_labels] = list
end
opts.on('--labels-pr x,y,z', Array, 'Only pull requests with specified labels will be included to changelog. Default is nil') do |list|
options[:pull_request_labels] = list