def self.method_added(method)
return if self == RHC::Commands::Base
return if private_method_defined? method
return if protected_method_defined? method
prefix = self.object_name
method_name = method.to_s == 'run' ? nil : method.to_s.gsub("_", "-")
name = [prefix, method_name].compact
raise InvalidCommand, "Either object_name must be set or a non default method defined" if name.empty?
aliases.each{ |a| a[:action].unshift(prefix) unless a[:root_command] } if prefix
RHC::Commands.add((@options || {}).merge({
:name => name,
:class => self,
:method => method
}));
@options = nil
end