lib/genomer-plugin-view.rb in genomer-plugin-view-0.0.5 vs lib/genomer-plugin-view.rb in genomer-plugin-view-0.0.6

- old
+ new

@@ -1,10 +1,11 @@ require 'genomer' class GenomerPluginView < Genomer::Plugin def run + return help if arguments.empty? self.class.fetch_view(arguments.shift).new(arguments,flags).run end def self.fetch_view(view) require 'genomer-plugin-view/' + view @@ -22,8 +23,23 @@ end hash[k] = v if k hash end + end + + def help + message = <<-STRING.unindent + Run `genomer man view COMMAND` to review available formats + Where COMMAND is one of the following: + STRING + + message + Dir[File.dirname(__FILE__) + '/genomer-plugin-view/*.rb']. + map{|f| File.basename(f).gsub('.rb','')}. + delete_if{|i| i == 'version'}. + delete_if{|i| i == 'gff_record_helper'}. + sort. + map{|i| " " * 2 + i}. + join("\n") + "\n" end end