6 require_gem 'choice', '>= 0.1.2'
11 header "Specific options:"
14 :short => '-s', :long => '--server SERVER',
15 :desc => ["The irc server to connect to.", "(default irc.freenode.org)"], :default => 'irc.freenode.org'
19 :short => '-p', :long => '--port PORT', :desc => ["The irc server's port.", "(default 6667)"],
20 :default => 6667, :cast => Integer
24 :short => '-n', :long => '--nick NICK', :desc => ["The irc bot's nick.", "(default matz)"],
29 :short => '-w', :long => '--password PASSWORD', :desc => "Your nick's password, if registered."
33 :short => '-c', :long => '--channel CHANNEL', :desc => ["The channel to join on connect -- without a hash.", "(default polymorphs)"],
34 :default => 'polymorphs'
38 :short => '-u', :long => '--user USER', :desc => ["The irc bot's username.", "(default matz)"], :default => 'matz'
42 :short => '-m', :long => '--name NAME', :desc => ["The irc bot's name.", "(default Matz)"], :default => 'Matz'
46 :short => '-d', :long => '--daemon',
47 :desc => ["Run as a daemon - pass it nothing, start, stop, or restart.", "If you pass nothing, `start' is assumed."]
50 :only_when_addressed => {
51 :short => '-a', :long => '--addressed',
52 :desc => ["Only speak if being addressed.", "(default false)"]
56 MatzBot::Session.load unless Choice.choices[:daemonize] == 'stop'
60 if Choice.choices[:daemonize]
61 MatzBot::Daemonize.daemonize(Choice.choices.merge('daemonize' => Choice.choices[:daemonize] == 'stop' ? 'stop' : 'start'))
63 MatzBot::Daemonize.store
65 MatzBot::Client.start(Choice.choices)