diff options
Diffstat (limited to 'bin/rbot')
-rwxr-xr-x | bin/rbot | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -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 |