summaryrefslogtreecommitdiff
path: root/bin/rbot
diff options
context:
space:
mode:
Diffstat (limited to 'bin/rbot')
-rwxr-xr-xbin/rbot14
1 files changed, 12 insertions, 2 deletions
diff --git a/bin/rbot b/bin/rbot
index 962f3d0d..f65cb949 100755
--- a/bin/rbot
+++ b/bin/rbot
@@ -35,7 +35,7 @@ rescue LoadError => e
exit 2
end
-$debug = true
+$debug = false
$version="0.9.8"
$opts = Hash.new
@@ -47,7 +47,8 @@ end
opts = GetoptLong.new(
["--debug", "-d", GetoptLong::NO_ARGUMENT],
- ["--help", "-h", GetoptLong::OPTIONAL_ARGUMENT],
+ ["--help", "-h", GetoptLong::NO_ARGUMENT],
+ ["--trace", "-t", GetoptLong::REQUIRED_ARGUMENT],
["--version", "-v", GetoptLong::NO_ARGUMENT]
)
@@ -56,6 +57,15 @@ opts.each {|opt, arg|
$opts[opt.sub(/^-+/, "")] = arg
}
+if ($opts["trace"])
+ set_trace_func proc { |event, file, line, id, binding, classname|
+ if classname.to_s == $opts["trace"]
+ printf "TRACE: %8s %s:%-2d %10s %8s\n", event, File.basename(file), line, id, classname
+ end
+ }
+end
+
+
if ($opts["version"])
puts "rbot #{$version}"
exit 0