diff options
author | Tom Gilbert <tom@linuxbrit.co.uk> | 2005-07-27 17:20:00 +0000 |
---|---|---|
committer | Tom Gilbert <tom@linuxbrit.co.uk> | 2005-07-27 17:20:00 +0000 |
commit | 20b78c45b2e514c9c022e25c7c1d6b0cb0f3769c (patch) | |
tree | d367a734ad000f3edd0ba7e56c2a00df1faeb6d7 /bin | |
parent | aabe8920ae1e120587c8e27a62827d28afdc04e5 (diff) |
more packaging work
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/rbot | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -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 |