()
CLI frontend to MakeDepsFile.
CLI frontend to MakeDepsFile.
CLI frontend to MakeDepsFile .
def main():
  """CLI frontend to MakeDepsFile."""
  logging.basicConfig(format=(sys.argv[0] + ': %(message)s'),
                      level=logging.INFO)
  options, args = _GetOptionsParser().parse_args()

  path_to_source = {}

  # Roots without prefixes
  for root in options.roots:
    path_to_source.update(_GetRelativePathToSourceDict(root))

  # Roots with prefixes
  for root_and_prefix in options.roots_with_prefix:
    root, prefix = _GetPair(root_and_prefix)
    path_to_source.update(_GetRelativePathToSourceDict(root, prefix=prefix))

  # Source paths
  for path in args:
    path_to_source[path] = source.Source(source.GetFileContents(path))

  # Source paths with alternate deps paths
  for path_with_depspath in options.paths_with_depspath:
    srcpath, depspath = _GetPair(path_with_depspath)
    path_to_source[depspath] = source.Source(source.GetFileContents(srcpath))

  # Make our output pipe.
  if options.output_file:
    out = open(options.output_file, 'w')
  else:
    out = sys.stdout

  out.write(('// This file was autogenerated by %s.\n' %
             os.path.basename(__file__)))
  out.write('// Please do not edit.\n')

  out.write(MakeDepsFile(path_to_source))
def main ( ) : logging . basicConfig ( format = ( sys . argv [ 0 ] + ': %(message)s' ) , level = logging . INFO ) options , args = _GetOptionsParser ( ) . parse_args ( ) path_to_source = { } # Roots without prefixes for root in options . roots : path_to_source . update ( _GetRelativePathToSourceDict ( root ) ) # Roots with prefixes for root_and_prefix in options . roots_with_prefix : root , prefix = _GetPair ( root_and_prefix ) path_to_source . update ( _GetRelativePathToSourceDict ( root , prefix = prefix ) ) # Source paths for path in args : path_to_source [ path ] = source . Source ( source . GetFileContents ( path ) ) # Source paths with alternate deps paths for path_with_depspath in options . paths_with_depspath : srcpath , depspath = _GetPair ( path_with_depspath ) path_to_source [ depspath ] = source . Source ( source . GetFileContents ( srcpath ) ) # Make our output pipe. if options . output_file : out = open ( options . output_file , 'w' ) else : out = sys . stdout out . write ( ( '// This file was autogenerated by %s.\n' % os . path . basename ( __file__ ) ) ) out . write ( '// Please do not edit.\n' ) out . write ( MakeDepsFile ( path_to_source ) )