Ollivier Robert
10/23/2003 11:23:00 AM
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 -=- roberto@eurocontrol.fr
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.