Problem with 1.8 / optparse.rb from within debugger

O

Ollivier Robert

Hi,

Am I the only who get the following error when trying to go step-by-step in
the debugger in the optparse code?

469 [13:11] roberto@caerdonn:ruby/LDAP> ruby -r debug ldap-infocentre.rb -d
Debug.rb
Emacs support available.

ldap-infocentre.rb:26:RCS_REV = "1"
(rdb:1) b 243
Set breakpoint 1 at ldap-infocentre.rb:243
(rdb:1) c
/usr/local/lib/ruby/1.8/optparse.rb:1621: unexpected return

472 [13:21] roberto@caerdonn:ruby/LDAP> ruby -v
ruby 1.8.0 (2003-09-09) [i386-freebsd5]

Line 1621 in optparse.rb is:

-=-=-
def options
@optparse ||= OptionParser.new
block_given? or return @optparse
begin
yield @optparse <<<<<<<< line 1621
rescue ParseError
@optparse.warn $!
nil
end
end
-=-=-

and the code it is trying to execute is the following. Works fine when run
outside "-r debug".

-=-=-
argv.options do |opts|
opts.banner = banner
opts.on("-d", "--debug", "Debugging") {
|$debug|
$debug = true
}
opts.on("-h", "--help", "Help") {
print opts
exit 0
}
opts.on("-u", "--uid-check", "Check uid & acronym") {
|uid_check|
}
opts.parse!
end
-=-=-

--
Ollivier ROBERT -=- Eurocontrol EEC/AMI -=- (e-mail address removed)
The Postman hits! The Postman hits! You have new mail.

____

This message and any files transmitted with it are legally privileged and intended for the sole use of the individual(s) or entity to whom they are addressed. If you are not the intended recipient, please notify the sender by reply and delete the message and any attachments from your system. Any unauthorised use or disclosure of the content of this message is strictly prohibited and may be unlawful.

Nothing in this e-mail message amounts to a contractual or legal commitment on the part of EUROCONTROL unless it is confirmed by appropriately signed hard copy.

Any views expressed in this message are those of the sender.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top