tft args
This commit is contained in:
+22
-3
@@ -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(); */
|
||||
|
||||
Reference in New Issue
Block a user