Update version according to OSCI-856
[packages/precise/mcollective.git] / plugins / mcollective / application / doc.rb
1 module MCollective
2   class Application::Doc<Application
3     description "Error message help"
4     usage "rpc help [ERROR]"
5
6     def post_option_parser(configuration)
7       configuration[:query] = ARGV.shift if ARGV.size > 0
8     end
9
10     def msg_template
11       File.read(Util.templatepath("msg-help.erb"))
12     end
13
14     def main
15       if configuration[:query] =~ /^PLMC\d+$/i
16         msg_code = configuration[:query].upcase
17         msg_example = Util.t("%s.example" % msg_code, :raise => true) rescue Util.t("%s.pattern" % msg_code)
18         msg_detail = Util.t("%s.expanded" % msg_code)
19
20         helptext = ERB.new(msg_template, 0, '%')
21         puts helptext.result(binding)
22       end
23     end
24   end
25 end