# File lib/clamp/help.rb, line 56 def initialize @out = StringIO.new end
# File lib/clamp/help.rb, line 71 def add_description(description) return unless description puts "" puts description.gsub(/^/, " ") end
# File lib/clamp/help.rb, line 79 def add_list(heading, items) puts "\n#{heading}:" items.reject { |i| i.respond_to?(:hidden?) && i.hidden? }.each do |item| label, description = item.help description.each_line do |line| puts format(DETAIL_FORMAT, label, line) label = "" end end end
# File lib/clamp/help.rb, line 64 def add_usage(invocation_path, usage_descriptions) puts Clamp.message(:usage_heading) + ":" usage_descriptions.each do |usage| puts " #{invocation_path} #{usage}".rstrip end end
# File lib/clamp/help.rb, line 60 def string @out.string end
# File lib/clamp/help.rb, line 92 def puts(*args) @out.puts(*args) end