add parsing feature, fix #38

This commit is contained in:
Petr Korolev 2014-12-11 18:04:11 +02:00
parent e6c0d49200
commit fcd78e6bc4

View File

@ -58,10 +58,16 @@ module GitHubChangelogGenerator
parser.parse!
#udefined case with 1 parameter:
if ARGV[0] && !ARGV[1]
puts parser.banner
exit
# this match should parse https://github.com/skywinder/Github-Changelog-Generator and skywinder/Github-Changelog-Generator to user and name
match = /(?:.+github\.com\/)?(.+)\/(.+)/.match(ARGV[0])
if match[2].nil?
exit
else
options[:user] = match[1]
options[:project]= match[2]
end
end
if !options[:user] && !options[:project]
@ -83,7 +89,6 @@ module GitHubChangelogGenerator
if ARGV[1]
options[:tag1] = ARGV[0]
options[:tag2] = ARGV[1]
end
options