require 'etc'
require 'getoptlong'
require 'fileutils'
-require 'rbconfig'
-begin
- require 'rbot/ircbot'
-rescue LoadError => e
- puts "Error: couldn't find the rbot/ircbot module for loading\n - did you install rbot using install.rb?"
- exit 2
-end
-
-$debug = false
-$version="0.9.8"
+$version="0.9.9"
$opts = Hash.new
-# print +message+ if debugging is enabled
-def debug(message=nil)
- print "DEBUG: #{message}\n" if($debug && message)
- #yield
-end
+orig_opts = ARGV.dup
opts = GetoptLong.new(
["--debug", "-d", GetoptLong::NO_ARGUMENT],
["--version", "-v", GetoptLong::NO_ARGUMENT]
)
+$debug = false
opts.each {|opt, arg|
$debug = true if(opt == "--debug")
$opts[opt.sub(/^-+/, "")] = arg
}
end
+begin
+ require 'rbot/ircbot'
+rescue LoadError => e
+ puts "Error: couldn't find the rbot/ircbot module for loading\n - did you install rbot using setup.rb?"
+ exit 2
+end
if ($opts["version"])
puts "rbot #{$version}"
exit 0
end
-if(bot = Irc::IrcBot.new(ARGV.shift))
+if(bot = Irc::IrcBot.new(ARGV.shift, :argv => orig_opts))
# just run the bot
bot.mainloop
end