    # File lib/rubygems/commands/generate_index_command.rb, line 46
      def execute
        if not File.exist?(options[:directory]) or
           not File.directory?(options[:directory]) then
          alert_error "unknown directory name #{directory}."
          terminate_interaction 1
        else
          indexer = Gem::Indexer.new options[:directory]
          indexer.generate_index
        end
      end