blob: 356c77197140845d246c855a18ddc20466731977 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#!/usr/bin/python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import processor
def GetInputs(args):
parser = argparse.ArgumentParser()
parser.add_argument("sources", nargs=argparse.ONE_OR_MORE)
parser.add_argument("-d", "--depends", nargs=argparse.ZERO_OR_MORE,
default=[])
parser.add_argument("-e", "--externs", nargs=argparse.ZERO_OR_MORE,
default=[])
opts = parser.parse_args(args)
files = set()
for file in opts.sources + opts.depends + opts.externs:
files.add(file)
files.update(processor.Processor(file).included_files)
return files
if __name__ == "__main__":
print "\n".join(GetInputs(sys.argv[1:]))
|