summaryrefslogtreecommitdiff
path: root/bin/find-unneeded-includes
diff options
context:
space:
mode:
Diffstat (limited to 'bin/find-unneeded-includes')
-rwxr-xr-xbin/find-unneeded-includes10
1 files changed, 8 insertions, 2 deletions
diff --git a/bin/find-unneeded-includes b/bin/find-unneeded-includes
index 9b38fd524f49..0e8cec276968 100755
--- a/bin/find-unneeded-includes
+++ b/bin/find-unneeded-includes
@@ -310,6 +310,8 @@ def main(argv):
help='The files to be checked')
parser.add_argument('--recursive', metavar='DIR', nargs=1, type=str,
help='Recursively search a directory for source files to check')
+ parser.add_argument('--headers', action='store_true',
+ help='Check header files. If omitted, check source files. Use with --recursive.')
args = parser.parse_args()
@@ -321,8 +323,12 @@ def main(argv):
if args.recursive:
for root, dirs, files in os.walk(args.recursive[0]):
for file in files:
- if (file.endswith(".cxx") or file.endswith(".hxx") or file.endswith(".hrc") or file.endswith(".h") or file.endswith(".c")):
- list_of_files.append(os.path.join(root,file))
+ if args.headers:
+ if (file.endswith(".hxx") or file.endswith(".hrc") or file.endswith(".h")):
+ list_of_files.append(os.path.join(root,file))
+ else:
+ if (file.endswith(".cxx") or file.endswith(".c")):
+ list_of_files.append(os.path.join(root,file))
else:
list_of_files = args.Files