code: def main():
      
      args = parse_command_line()
  
      logging_level = set_up_logging(logger, args.logging_level, args.should_be_quiet)
      defines = parse_definitions(args.definitions)
  
      try:
          content_types_db = ContentTypesDatabase(DEFAULT_CONTENT_TYPES_FILE)
          for config_file in args.content_types_config_files:
              content_types_db.add_config_file(config_file)
  
          output_filename = args.output_filename
  
          with open(args.input_filename, 'rb') as input_file:
              if output_filename is None:
                  # No output file specified. Will output to stdout.
                  preprocess(input_file=input_file,
                             output_file=sys.stdout,
                             defines=defines,
                             options=args,
                             content_types_db=content_types_db)
              else:
                  if os.path.exists(output_filename):
                      if args.should_force_overwrite:
                          # Overwrite existing file.
                          with open(output_filename, 'wb') as output_file:
                              preprocess(input_file=input_file,
                                         output_file=output_file,
                                         defines=defines,
                                         options=args,
                                         content_types_db=content_types_db)
                      else:
                          raise IOError("File `%s` exists - cannot overwrite. (Use -f to force overwrite.)" % args.output_filename)
                  else:
                      # File doesn't exist and output file is provided, so write.
                      with open(output_filename, 'wb') as output_file:
                          preprocess(input_file=input_file,
                                     output_file=output_file,
                                     defines=defines,
                                     options=args,
                                     content_types_db=content_types_db)
      except PreprocessorError, ex:
          if logging_level == logging.DEBUG:
              import traceback
              traceback.print_exc(file=sys.stderr)
          else:
              sys.stderr.write("pepe: error: %s\n" % str(ex))
          return 1
  
      return 0
docs: Entry-point function.