This is a legacy RCR. If this is your RCR, please resubmit it using the new format and process.
As I understand it the parsing stage of GetoptLong can throw one of four errors:
begin
GetoptLong.new().set_options(
[ ... ]
).each ...
rescue GetoptLong::Error
printHelp()
exit 1
end
I seem to have to do something like:
begin
GetoptLong.new().set_options(
[ ... ]
).each ...
rescue GetoptLong::AmbigousOption, GetoptLong::NeedlessArgument,
GetoptLong::MissingArgument, GetoptLong::InvalidOption
printHelp()
exit 1
end
That feels a little clumsy. I wonder if there is some reasoning behind this or would it make sense to change GetoptLong so that there is a catch-all parent class for the errors that it can throw?
Back to RCRchive.
RCR Submission page and RCRchive powered by Ruby, Apache, RuWiki (modified), and RubLog