-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
40 lines (32 loc) · 987 Bytes
/
main.cpp
File metadata and controls
40 lines (32 loc) · 987 Bytes
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
34
35
36
37
38
39
40
#include <filesystem>
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include "graphMaker.h"
#include "utils.h"
int main(int argc, char const* argv[])
{
// Input parsing
if (argc < 2)
{
std::cout << "Usage: " << argv[0] << " <path> [exclude list]\n";
return 1;
}
std::cout << "Starting to make your graph!\n";
// Path to the search folder
std::string path = argv[1];
// Folders to exclude
std::vector<std::string> excludes;
for (size_t i = 2; i < argc; i++)
{
excludes.emplace_back(argv[i]);
}
// Extensions to search
std::vector<std::string> extensions{".cpp", ".hpp", ".c", ".h"};
std::vector<std::filesystem::directory_entry> files = utils::getFilesByFilter(path, extensions, excludes);
std::ofstream output_file{"includes.txt", std::ofstream::out | std::ofstream::trunc};
printIncludeGraph(output_file, files);
std::cout << "Done!\n";
return 0;
}