diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-07-20 17:17:15 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-07-20 17:17:15 +0000 |
commit | eff60cfe6dcdfc45fc4e3d9fc158becaaf390efc (patch) | |
tree | ca468dcf09ae8985656811017e1d48c8f164dd24 /bin/rbot | |
parent | 6a2e8cb6f631cf73031843eea3405e4bb21fc0c2 (diff) |
Add --background option to daemonize the bot
Diffstat (limited to 'bin/rbot')
-rwxr-xr-x | bin/rbot | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -36,12 +36,16 @@ opts = GetoptLong.new( ["--debug", "-d", GetoptLong::NO_ARGUMENT], ["--help", "-h", GetoptLong::NO_ARGUMENT], ["--trace", "-t", GetoptLong::REQUIRED_ARGUMENT], - ["--version", "-v", GetoptLong::NO_ARGUMENT] + ["--version", "-v", GetoptLong::NO_ARGUMENT], + ["--background", "-b", GetoptLong::NO_ARGUMENT] ) $debug = false +$daemonize = false + opts.each {|opt, arg| $debug = true if(opt == "--debug") + $daemonize = true if(opt == "--background") $opts[opt.sub(/^-+/, "")] = arg } @@ -79,6 +83,7 @@ if ($opts["help"]) puts " -h, --help this message" puts " -v, --version version information" puts " -d, --debug enable debug messages" + puts " -b, --background background (daemonize) the bot" puts "config directory defaults to ~/.rbot" exit 0 end |