diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-06-30 11:37:37 +0200 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-06-30 12:00:39 +0200 |
commit | 8dd10a34da81fd11c562dd4db6a23a6f4abc533c (patch) | |
tree | 5e781a21d2bd6b73a1742874b567dd1f627c211e | |
parent | 0a9b24b1be678371a661785445878a76b9a873ec (diff) |
Add a cal.path option with the path to the cal program.
-rw-r--r-- | data/rbot/plugins/cal.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/data/rbot/plugins/cal.rb b/data/rbot/plugins/cal.rb index dd1d1538..bfac39e5 100644 --- a/data/rbot/plugins/cal.rb +++ b/data/rbot/plugins/cal.rb @@ -1,12 +1,21 @@ class CalPlugin < Plugin + Config.register Config::StringValue.new('cal.path', + :default => '/usr/bin/cal', + :desc => _('Path to the cal program')) + def help(plugin, topic="") "cal [month year] => show current calendar [optionally specify month and year]" end + + def cal_path + @bot.config["cal.path"] + end + def cal(m, params) if params.has_key?(:month) - m.reply Utils.safe_exec("cal", params[:month], params[:year]) + m.reply Utils.safe_exec(cal_path, params[:month], params[:year]) else - m.reply Utils.safe_exec("cal") + m.reply Utils.safe_exec(cal_path) end end end |