module Thor::Base::ClassMethods

def find_and_refresh_command(name) #:nodoc:

:nodoc:
current command hash.
class, just return it, otherwise dup it and add the fresh copy to the
Finds a command with the given name. If the command belongs to the current
def find_and_refresh_command(name) #:nodoc:
  if commands[name.to_s]
    commands[name.to_s]
  elsif command = all_commands[name.to_s] # rubocop:disable AssignmentInCondition
    commands[name.to_s] = command.clone
  else
    raise ArgumentError, "You supplied :for => #{name.inspect}, but the command #{name.inspect} could not be found."
  end
end