X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=data%2Frbot%2Fplugins%2Fcal.rb;h=c649084a14394df93cc2306b7f9df11bce0d22b1;hb=052217de30c59206d7025b582d4604557a747470;hp=4f28310b60f640cd721eb0398302fb16e92eed98;hpb=21949774b91eaec6ecde4eaa8ad121e2c0a36b87;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/cal.rb b/data/rbot/plugins/cal.rb index 4f28310b..c649084a 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 => '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