class RHC::CommandHelpBindings

Public Class Methods

new(command, instance_commands, runner) click to toggle source
# File lib/rhc/help_formatter.rb, line 34
def initialize(command, instance_commands, runner)
  @command = command
  @actions =
    if command.root?
      instance_commands.sort_by{ |c| c[0] }.collect do |command_name, command_class|
        next if command_class.summary.nil?
        m = /^#{command.name}[\-]([^ ]+)/.match(command_name)
        # if we have a match and it is not an alias then we can use it
        m and command_name == command_class.name ? {:name => m[1], :summary => command_class.summary || ""} : nil
      end
    else
      []
    end
  @actions.compact!
  @global_options = runner.options
  @runner = runner
end

Public Instance Methods

program(*args) click to toggle source
# File lib/rhc/help_formatter.rb, line 51
def program(*args)
  @runner.program *args
end