code: def ParseOptions(cls, options, output_module):
      
      if not isinstance(output_module, xlsx.XLSXOutputModule):
        raise errors.BadConfigObject(
            'Output module is not an instance of XLSXOutputModule')
  
      fields = cls._ParseStringOption(
          options, 'fields', default_value=cls._DEFAULT_FIELDS)
  
      additional_fields = cls._ParseStringOption(options, 'additional_fields')
  
      if additional_fields:
        fields = '{0:s},{1:s}'.format(fields, additional_fields)
  
      filename = getattr(options, 'write', None)
      if not filename:
        raise errors.BadConfigOption(
            'Output filename was not provided use "-w filename" to specify.')
  
      timestamp_format = cls._ParseStringOption(
          options, 'timestamp_format',
          default_value=cls._DEFAULT_TIMESTAMP_FORMAT)
  
      output_module.SetFields([
          field_name.strip() for field_name in fields.split(',')])
      output_module.SetFilename(filename)
      output_module.SetTimestampFormat(timestamp_format)
docs: Parses and validates options.
  
      Args:
        options (argparse.Namespace): parser options.
        output_module (XLSXOutputModule): output module to configure.
  
      Raises:
        BadConfigObject: when the output module object is of the wrong type.
        BadConfigOption: when the output filename was not provided.