aboutsummaryrefslogtreecommitdiff
path: root/bindings/python/examples/cindex/cindex-dump.py
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-02-13 18:33:28 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-02-13 18:33:28 +0000
commit8bb44d5c86eda99c68acffacbe3ab5ca89453c9a (patch)
tree15c222841aea9e8e7b162481b0e480424aa933c6 /bindings/python/examples/cindex/cindex-dump.py
parentef7f798c0921cde7e665935a5630578cc1065e0f (diff)
cindex/Python: Fix cindex-{dump,includes} examples to just pass all args
directly to Index, instead of requiring the input file to be first. This makes the examples behave more like 'clang'. For example, ddunbar@giles:tmp$ echo '#include <string>' | python ~/llvm/tools/clang/bindings/python/examples/cindex/cindex-includes.py -- -x c++ - | wc -l 114 ddunbar@giles:tmp$ echo '#include <stdio.h>' | python ~/llvm/tools/clang/bindings/python/examples/cindex/cindex-includes.py -- -x c - | wc -l 10 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96107 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings/python/examples/cindex/cindex-dump.py')
-rw-r--r--bindings/python/examples/cindex/cindex-dump.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/bindings/python/examples/cindex/cindex-dump.py b/bindings/python/examples/cindex/cindex-dump.py
index ace4ae8276..af7ddab6ea 100644
--- a/bindings/python/examples/cindex/cindex-dump.py
+++ b/bindings/python/examples/cindex/cindex-dump.py
@@ -74,10 +74,8 @@ def main():
if len(args) == 0:
parser.error('invalid number arguments')
- input_path = args.pop(0)
-
index = Index.create()
- tu = index.parse(input_path, args)
+ tu = index.parse(None, args)
if not tu:
parser.error("unable to load input")