mason/src/main.cpp

35 lines
658 B
C++
Raw Normal View History

2023-08-30 20:54:59 +00:00
#include <string>
#include "project.h"
2023-08-27 17:55:04 +00:00
int main(int argc, char *argv[]) {
2023-08-30 20:54:59 +00:00
std::string firstArg;
2023-09-01 21:39:24 +00:00
std::string secondArg;
2023-08-30 20:54:59 +00:00
if (argc > 1)
firstArg = argv[1];
else
firstArg = "./";
2023-09-01 21:39:24 +00:00
if (argc > 2)
secondArg = argv[2];
else
secondArg = "./";
Project root(firstArg, secondArg);
2023-08-30 20:54:59 +00:00
bool success = root.read();
2023-09-01 21:39:24 +00:00
int result = -1;
if (success) {
root.info("successfully parsed project " + root.getName());
root.info("dependencies count is " + std::to_string(root.dependenciesCount()));
2023-08-30 20:54:59 +00:00
2023-09-01 21:39:24 +00:00
root.discover();
result = 0;
2023-08-30 20:54:59 +00:00
}
2023-09-01 21:39:24 +00:00
root.printLog();
2023-08-30 20:54:59 +00:00
2023-09-01 21:39:24 +00:00
return result;
2023-08-27 17:55:04 +00:00
}