
Submitted by anonymous (Tue Dec 10 13:12:50 UTC 2002)
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
endI 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
endThat 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?

| Comments | Current voting | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|


RCRchive copyright © David Alan Black, 2003-2005.
Powered by .