tools/generate_stubs/generate_stubs.py
def CreateOptionParser():
  """Creates an OptionParser for the configuration options of script.

  Returns:
    A OptionParser object.
  """
  parser = optparse.OptionParser(usage='usage: %prog [options] input')
  parser.add_option('-o',
                    '--output',
                    dest='out_dir',
                    default=None,
                    help='Output location.')
  parser.add_option(
      '-i',
      '--intermediate_dir',
      dest='intermediate_dir',
      default=None,
      help=('Location of intermediate files. Ignored for %s type' %
            FILE_TYPE_WIN_DEF))
  parser.add_option('-t',
                    '--type',
                    dest='type',
                    default=None,
                    help=('Type of file. Valid types are "%s" or "%s" or "%s" '
                          'or "%s"' % (FILE_TYPE_POSIX_STUB, FILE_TYPE_WIN_X86,
                                       FILE_TYPE_WIN_X64, FILE_TYPE_WIN_DEF)))
  parser.add_option('-s',
                    '--stubfile_name',
                    dest='stubfile_name',
                    default=None,
                    help=('Name of posix_stubs output file. Only valid with '
                          '%s type.' % FILE_TYPE_POSIX_STUB))
  parser.add_option('-p',
                    '--path_from_source',
                    dest='path_from_source',
                    default=None,
                    help=('The relative path from the project root that the '
                          'generated file should consider itself part of (eg. '
                          'third_party/ffmpeg).  This is used to generate the '
                          'header guard and namespace for our initializer '
                          'functions and does NOT affect the physical output '
                          'location of the file like -o does.  Ignored for '
                          '%s and %s types.' %
                          (FILE_TYPE_WIN_X86, FILE_TYPE_WIN_X64)))
  parser.add_option('-e',
                    '--extra_stub_header',
                    dest='extra_stub_header',
                    default=None,
                    help=('File to insert after the system includes in the '
                          'generated stub implementation file. Ignored for '
                          '%s and %s types.' %
                          (FILE_TYPE_WIN_X86, FILE_TYPE_WIN_X64)))
  parser.add_option('-m',
                    '--module_name',
                    dest='module_name',
                    default=None,
                    help=('Name of output DLL or LIB for DEF creation using '
                          '%s type.' % FILE_TYPE_WIN_DEF))
  parser.add_option('-x',
                    '--export_macro',
                    dest='export_macro',
                    default='',
                    help=('A macro to place between the return type and '
                          'function name, e.g. MODULE_EXPORT, to control the '
                          'visibility of the stub functions.'))
  parser.add_option('-l',
                    '--logging-function',
                    dest='logging_function',
                    default='VLOG(1)',
                    help=('Function call that will be used for error logging.'))
  parser.add_option('-n',
                    '--logging-include',
                    dest='logging_include',
                    default='base/logging.h',
                    help=('Header file where the logging function is defined.'))

  return parser
Creates an OptionParser for the configuration options of script.

  Returns:
    A OptionParser object.
  
Creates an OptionParser for the configuration options of script.
Creates an OptionParser for the configuration options of script .
def CreateOptionParser():
  parser = optparse.OptionParser(usage='usage: %prog [options] input')
  parser.add_option('-o',
                    '--output',
                    dest='out_dir',
                    default=None,
                    help='Output location.')
  parser.add_option(
      '-i',
      '--intermediate_dir',
      dest='intermediate_dir',
      default=None,
      help=('Location of intermediate files. Ignored for %s type' %
            FILE_TYPE_WIN_DEF))
  parser.add_option('-t',
                    '--type',
                    dest='type',
                    default=None,
                    help=('Type of file. Valid types are "%s" or "%s" or "%s" '
                          'or "%s"' % (FILE_TYPE_POSIX_STUB, FILE_TYPE_WIN_X86,
                                       FILE_TYPE_WIN_X64, FILE_TYPE_WIN_DEF)))
  parser.add_option('-s',
                    '--stubfile_name',
                    dest='stubfile_name',
                    default=None,
                    help=('Name of posix_stubs output file. Only valid with '
                          '%s type.' % FILE_TYPE_POSIX_STUB))
  parser.add_option('-p',
                    '--path_from_source',
                    dest='path_from_source',
                    default=None,
                    help=('The relative path from the project root that the '
                          'generated file should consider itself part of (eg. '
                          'third_party/ffmpeg).  This is used to generate the '
                          'header guard and namespace for our initializer '
                          'functions and does NOT affect the physical output '
                          'location of the file like -o does.  Ignored for '
                          '%s and %s types.' %
                          (FILE_TYPE_WIN_X86, FILE_TYPE_WIN_X64)))
  parser.add_option('-e',
                    '--extra_stub_header',
                    dest='extra_stub_header',
                    default=None,
                    help=('File to insert after the system includes in the '
                          'generated stub implementation file. Ignored for '
                          '%s and %s types.' %
                          (FILE_TYPE_WIN_X86, FILE_TYPE_WIN_X64)))
  parser.add_option('-m',
                    '--module_name',
                    dest='module_name',
                    default=None,
                    help=('Name of output DLL or LIB for DEF creation using '
                          '%s type.' % FILE_TYPE_WIN_DEF))
  parser.add_option('-x',
                    '--export_macro',
                    dest='export_macro',
                    default='',
                    help=('A macro to place between the return type and '
                          'function name, e.g. MODULE_EXPORT, to control the '
                          'visibility of the stub functions.'))
  parser.add_option('-l',
                    '--logging-function',
                    dest='logging_function',
                    default='VLOG(1)',
                    help=('Function call that will be used for error logging.'))
  parser.add_option('-n',
                    '--logging-include',
                    dest='logging_include',
                    default='base/logging.h',
                    help=('Header file where the logging function is defined.'))
  return parser
def CreateOptionParser ( ) : parser = optparse . OptionParser ( usage = 'usage: %prog [options] input' ) parser . add_option ( '-o' , '--output' , dest = 'out_dir' , default = None , help = 'Output location.' ) parser . add_option ( '-i' , '--intermediate_dir' , dest = 'intermediate_dir' , default = None , help = ( 'Location of intermediate files. Ignored for %s type' % FILE_TYPE_WIN_DEF ) ) parser . add_option ( '-t' , '--type' , dest = 'type' , default = None , help = ( 'Type of file. Valid types are "%s" or "%s" or "%s" ' 'or "%s"' % ( FILE_TYPE_POSIX_STUB , FILE_TYPE_WIN_X86 , FILE_TYPE_WIN_X64 , FILE_TYPE_WIN_DEF ) ) ) parser . add_option ( '-s' , '--stubfile_name' , dest = 'stubfile_name' , default = None , help = ( 'Name of posix_stubs output file. Only valid with ' '%s type.' % FILE_TYPE_POSIX_STUB ) ) parser . add_option ( '-p' , '--path_from_source' , dest = 'path_from_source' , default = None , help = ( 'The relative path from the project root that the ' 'generated file should consider itself part of (eg. ' 'third_party/ffmpeg).  This is used to generate the ' 'header guard and namespace for our initializer ' 'functions and does NOT affect the physical output ' 'location of the file like -o does.  Ignored for ' '%s and %s types.' % ( FILE_TYPE_WIN_X86 , FILE_TYPE_WIN_X64 ) ) ) parser . add_option ( '-e' , '--extra_stub_header' , dest = 'extra_stub_header' , default = None , help = ( 'File to insert after the system includes in the ' 'generated stub implementation file. Ignored for ' '%s and %s types.' % ( FILE_TYPE_WIN_X86 , FILE_TYPE_WIN_X64 ) ) ) parser . add_option ( '-m' , '--module_name' , dest = 'module_name' , default = None , help = ( 'Name of output DLL or LIB for DEF creation using ' '%s type.' % FILE_TYPE_WIN_DEF ) ) parser . add_option ( '-x' , '--export_macro' , dest = 'export_macro' , default = '' , help = ( 'A macro to place between the return type and ' 'function name, e.g. MODULE_EXPORT, to control the ' 'visibility of the stub functions.' ) ) parser . add_option ( '-l' , '--logging-function' , dest = 'logging_function' , default = 'VLOG(1)' , help = ( 'Function call that will be used for error logging.' ) ) parser . add_option ( '-n' , '--logging-include' , dest = 'logging_include' , default = 'base/logging.h' , help = ( 'Header file where the logging function is defined.' ) ) return parser
Creates an OptionParser for the configuration options of script.
Creates an OptionParser for the configuration options of script .
"""Creates an OptionParser for the configuration options of script.

  Returns:
    A OptionParser object.
  """
A OptionParser object.
A OptionParser object .