Class: Gorails::Commands::Help

Inherits:
Gorails::Command
  • Object
show all
Defined in:
lib/gorails/commands/help.rb

Instance Method Summary collapse

Instance Method Details

#call(args, _name) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/gorails/commands/help.rb', line 6

def call(args, _name)
  puts CLI::UI.fmt("{{bold:Available commands}}")
  puts ""

  Gorails::Commands::Registry.resolved_commands.each do |name, klass|
    next if name == "help"
    puts CLI::UI.fmt("{{command:#{Gorails::TOOL_NAME} #{name}}}")
    if (help = klass.help)
      puts CLI::UI.fmt(help)
    end
    puts ""
  end
end