class Rails::Command::Base

def command_name

Rails::Command::TestCommand.command_name # => 'test'

Return command name without namespaces.
def command_name
  @command_name ||= if command = name.to_s.split("::").last
    command.chomp!("Command")
    command.underscore
  end
end