This commit is contained in:
vrd
2023-02-25 21:52:00 +02:00
parent 222c3e43be
commit 2310343c8a
5 changed files with 46 additions and 12 deletions
+22 -3
View File
@@ -3,16 +3,35 @@
#include "tree.hpp"
#include "utils.hpp"
#include "parser.hpp"
#include <string_view>
using std::string_view;
/* using std::cin; */
/* using std::cout; */
using std::cerr;
using namespace std::literals;
int main(int argc, char* argv[])
{
init();
auto f = mapfile("example_tree.tft");
parseTftFile(f).display();
if(argc < 2)
{
cerr << "Usage: tft FILES...\nTry 'tft --help' for more information";
return 1;
}
for(int i = 1; i < argc; ++i)
{
if(string_view(argv[i]) == "--help"sv) /* sv worth it? */
{
/* todo */
return 0; /* todo exit curses */
}
fd_t file = openOrDie(argv[i]);
parseTftFile(file).display();
}
Tree test1("Dechkovi");
/* test1.loadFromFile(); */