]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/cal.rb
* external execute plugin default to non-absolute paths
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / cal.rb
index 4f28310b60f640cd721eb0398302fb16e92eed98..9190f8e9dbbefb8f10149fa11c0e8c254c8bbf72 100644 (file)
@@ -1,12 +1,21 @@
 class CalPlugin < Plugin
+  Config.register Config::StringValue.new('cal.path',
+     :default => 'cal',
+     :desc => _('Path to the cal program'))
+
   def help(plugin, topic="")
-    "cal [options] => show current calendar [unix cal options]"
+    "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