class RDoc::RDoc

def document(argv)

def document(argv)
  RDoc::TopLevel.reset
  RDoc::Parser::C.reset
  @options = RDoc::Options.new
  @options.parse argv
  if @options.pipe then
    handle_pipe
    exit
  end
  @exclude = @options.exclude
  @last_modified = setup_output_dir @options.op_dir, @options.force_update
  start_time = Time.now
  file_info = parse_files @options.files
  @options.title = "RDoc Documentation"
  if file_info.empty?
    $stderr.puts "\nNo newer files." unless @options.quiet
  else
    gen_klass = @options.generator
    unless @options.quiet then
      $stderr.puts "\nGenerating #{gen_klass.name.sub(/^.*::/, '')}..."
    end
    @generator = gen_klass.for @options
    pwd = Dir.pwd
    Dir.chdir @options.op_dir do
      begin
        self.class.current = self
        @generator.generate file_info
        update_output_dir ".", start_time, @last_modified
      ensure
        self.class.current = nil
      end
    end
  end
  unless @options.quiet or not @stats then
    puts
    @stats.print
  end
end