add parsing feature, fix #38
This commit is contained in:
parent
e6c0d49200
commit
fcd78e6bc4
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user