def ParseOptions(cls, options, analysis_plugin):
    """Parses and validates options.

    Args:
      options (argparse.Namespace): parser options.
      analysis_plugin (WindowsServicePlugin): analysis plugin to configure.

    Raises:
      BadConfigObject: when the output module object is of the wrong type.
    """
    if not isinstance(
        analysis_plugin, windows_services.WindowsServicesAnalysisPlugin):
      raise errors.BadConfigObject((
          'Analysis plugin is not an instance of '
          'WindowsServicesAnalysisPlugin'))

    output_format = cls._ParseStringOption(
        options, 'windows_services_output', default_value=cls._DEFAULT_OUTPUT)
    analysis_plugin.SetOutputFormat(output_format)
Parses and validates options.

    Args:
      options (argparse.Namespace): parser options.
      analysis_plugin (WindowsServicePlugin): analysis plugin to configure.

    Raises:
      BadConfigObject: when the output module object is of the wrong type.