class Swiftproj::HelpCommand

Public Class Methods

description() click to toggle source
# File lib/swiftproj/commands/help_command.rb, line 3
def self.description()
  return "Displays this help message"
end

Public Instance Methods

run(options) click to toggle source
# File lib/swiftproj/commands/help_command.rb, line 7
def run(options)
  message = Swiftproj.constants
    .map { |symbol| symbol.to_s }
    .select { |name| name != "Command" and name.end_with?("Command") }
    .map { |name| Swiftproj.const_get(name) }
    .map { |cls|
      "    " + cls.command_name.ljust(22).green + cls.description
    }
    .join("\n")
  @ui.puts(message)
end