implement "issues" parsing + check for merged requests
This commit is contained in:
@@ -3,7 +3,7 @@ require 'optparse'
|
||||
|
||||
class Parser
|
||||
def self.parse_options
|
||||
options = {:tag1 => nil, :tag2 => nil, :format => '%d/%m/%y', :output => 'CHANGELOG.md'}
|
||||
options = {:tag1 => nil, :tag2 => nil, :format => '%d/%m/%y', :output => 'CHANGELOG.md', :labels => %w(bug enhancement)}
|
||||
|
||||
parser = OptionParser.new { |opts|
|
||||
opts.banner = 'Usage: changelog_generator --user username --project project_name [options]'
|
||||
@@ -23,7 +23,10 @@ class Parser
|
||||
opts.on('-v', '--[no-]verbose', 'Run verbosely') do |v|
|
||||
options[:verbose] = v
|
||||
end
|
||||
opts.on('-l', '--last-changes', 'Generate log between only last 2 tags') do |last|
|
||||
opts.on('-i', '--[no-]issues', 'Include closed issues to changelog') do |v|
|
||||
options[:issues] = v
|
||||
end
|
||||
opts.on('-l', '--last-changes', 'Generate log between last 2 tags only') do |last|
|
||||
options[:last] = last
|
||||
end
|
||||
opts.on('-f', '--date-format [FORMAT]', 'Date format. Default is %d/%m/%y') do |last|
|
||||
@@ -32,6 +35,9 @@ class Parser
|
||||
opts.on('-o', '--output [NAME]', 'Output file. Default is CHANGELOG.md') do |last|
|
||||
options[:output] = last
|
||||
end
|
||||
opts.on('--labels x,y,z', Array, 'List of labels. Issues with that labels will be included to changelog. Default is \'bug,enhancement\'') do |list|
|
||||
options[:labels] = list
|
||||
end
|
||||
}
|
||||
|
||||
parser.parse!
|
||||
|
||||
Reference in New Issue
Block a user