X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=plugins%2Fmcollective%2Fapplication%2Fdoc.rb;fp=plugins%2Fmcollective%2Fapplication%2Fdoc.rb;h=07de85b9a996cffb61a0d130701afd6ca72a67d4;hb=b87d2f4e68281062df1913440ca5753ae63314a9;hp=0000000000000000000000000000000000000000;hpb=ab0ea530b8ac956091f17b104ab2311336cfc250;p=packages%2Fprecise%2Fmcollective.git diff --git a/plugins/mcollective/application/doc.rb b/plugins/mcollective/application/doc.rb new file mode 100644 index 0000000..07de85b --- /dev/null +++ b/plugins/mcollective/application/doc.rb @@ -0,0 +1,25 @@ +module MCollective + class Application::Doc 0 + end + + def msg_template + File.read(File.join(Config.instance.helptemplatedir, "msg-help.erb")) + end + + def main + if configuration[:query] =~ /^PLMC\d+$/i + msg_code = configuration[:query].upcase + msg_example = Util.t("%s.example" % msg_code, :raise => true) rescue Util.t("%s.pattern" % msg_code) + msg_detail = Util.t("%s.expanded" % msg_code) + + helptext = ERB.new(msg_template, 0, '%') + puts helptext.result(binding) + end + end + end +end