hokein created this revision.
hokein added a reviewer: ioeric.
hokein added subscribers: bkramer, cfe-commits.

Also show a better error message.

http://reviews.llvm.org/D20469

Files:
  include-fixer/tool/clang-include-fixer.py

Index: include-fixer/tool/clang-include-fixer.py
===================================================================
--- include-fixer/tool/clang-include-fixer.py
+++ include-fixer/tool/clang-include-fixer.py
@@ -37,6 +37,14 @@
                       help='String to initialize the database.')
   args = parser.parse_args()
 
+  # Check whether the path of clang-include-fixer binary is valid.
+  try:
+    invocation = [binary, '-help']
+    subprocess.check_output(invocation)
+  except:
+    print >>sys.stderr, "Unable to find clang-include-fixer binary."
+    return
+
   # Get the current text.
   buf = vim.current.buffer
   text = '\n'.join(buf)


Index: include-fixer/tool/clang-include-fixer.py
===================================================================
--- include-fixer/tool/clang-include-fixer.py
+++ include-fixer/tool/clang-include-fixer.py
@@ -37,6 +37,14 @@
                       help='String to initialize the database.')
   args = parser.parse_args()
 
+  # Check whether the path of clang-include-fixer binary is valid.
+  try:
+    invocation = [binary, '-help']
+    subprocess.check_output(invocation)
+  except:
+    print >>sys.stderr, "Unable to find clang-include-fixer binary."
+    return
+
   # Get the current text.
   buf = vim.current.buffer
   text = '\n'.join(buf)
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to