module Fuelcell::Help

Public Class Methods

generate(root, args = [], width = 80) click to toggle source
# File lib/fuelcell/help.rb, line 11
def generate(root, args = [], width = 80)
  data = Builder.new.call(root, args)
  text = UsageFormatter.new(width: width).call(data)

  line = DescFormatter.new(width: width).call(data)
  text << "\n" + line unless line.empty?

  line = OptsFormatter.new(width: width).call(data)
  text << "\n" + line unless line.empty?

  line = CmdsFormatter.new(width: width).call(data)
  text << "\n" + line unless line.empty?
  text
end