summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTom Gilbert <tom@linuxbrit.co.uk>2005-07-27 17:20:00 +0000
committerTom Gilbert <tom@linuxbrit.co.uk>2005-07-27 17:20:00 +0000
commit20b78c45b2e514c9c022e25c7c1d6b0cb0f3769c (patch)
treed367a734ad000f3edd0ba7e56c2a00df1faeb6d7 /bin
parentaabe8920ae1e120587c8e27a62827d28afdc04e5 (diff)
more packaging work
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