Rescue invalid commands and present the valid options list (#498)

* rescue invalid commands

* recuse invalid command
This commit is contained in:
Lucas Huang 2017-05-14 12:30:43 -07:00 committed by Olle Jonsson
parent 1492c406e9
commit 9bbfa3add5

View File

@ -13,7 +13,10 @@ module GitHubChangelogGenerator
ParserFile.new(options).parse! ParserFile.new(options).parse!
parser = setup_parser(options) parser = setup_parser(options)
parser.parse! begin parser.parse!
rescue OptionParser::InvalidOption => e
abort [e, parser].join("\n")
end
fetch_user_and_project(options) fetch_user_and_project(options)