Skip to content

Commit 94ef299

Browse files
committed
Only include header files when scanning directories in CLI.
1 parent 5352b6f commit 94ef299

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/CLI/CLI.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.IO;
4+
using System.Linq;
45
using Mono.Options;
56

67
namespace CppSharp
@@ -188,10 +189,9 @@ static void GetFilesFromPath(string path, List<string> errorMessages)
188189
}
189190
else
190191
{
191-
string[] files = Directory.GetFiles(path);
192-
193-
foreach (string s in files)
194-
options.HeaderFiles.Add(s);
192+
var files = Directory.GetFiles(path).Where(f =>
193+
Path.GetExtension(f) == ".h" || Path.GetExtension(f) == ".hpp");
194+
options.HeaderFiles.AddRange(files);
195195
}
196196
}
197197
catch (Exception)

0 commit comments

Comments
 (0)