summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/rbot18
1 files changed, 15 insertions, 3 deletions
diff --git a/bin/rbot b/bin/rbot
index c46b9571..9af50916 100755
--- a/bin/rbot
+++ b/bin/rbot
@@ -25,10 +25,16 @@ $VERBOSE=true
require 'etc'
require 'getoptlong'
-require 'rbot/ircbot'
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 = true
$version="0.9.8"
$opts = Hash.new
@@ -40,8 +46,9 @@ def debug(message=nil)
end
opts = GetoptLong.new(
- [ "--debug", "-d", GetoptLong::NO_ARGUMENT ],
- [ "--help", "-h", GetoptLong::OPTIONAL_ARGUMENT ]
+ ["--debug", "-d", GetoptLong::NO_ARGUMENT],
+ ["--help", "-h", GetoptLong::OPTIONAL_ARGUMENT],
+ ["--version", "-v", GetoptLong::NO_ARGUMENT]
)
opts.each {|opt, arg|
@@ -49,6 +56,11 @@ opts.each {|opt, arg|
$opts[opt.sub(/^-+/, "")] = arg
}
+if ($opts["version"])
+ puts "rbot #{$version}"
+ exit 0
+end
+
if(bot = Irc::IrcBot.new(ARGV.shift))
if($opts["help"])
# query bot help from the commandline