Program now takes options instead of hardcoded inputs
[biaweb2.git] / biaweb.cpp
index d0c284e..8e87ab8 100644 (file)
@@ -1,23 +1,7 @@
-#include <iostream>
-#include <fstream>
-#include <getopt.h>
-#include "biawebdocumenttree.hpp"
-using namespace biaweb;
-
-int main (int argc, char *argv[]) {
-    // Compute the speed of generating the document tree and output HTML from sources
-    std::chrono::steady_clock::time_point t1 (std::chrono::steady_clock::now());
-
-    // An empty document tree
-    std::unique_ptr<DocumentTree> tree (new DocumentTree ("")); 
-    tree.get()->document_tree_builder ("Test/Reviews");
-    std::cout << VISUALIZE_TREE << std::endl;
-    tree.get()->visualize_tree ();
-    Template tpl ("templates");
-    tree.get()->create_tree_html (&tpl, "Test/Out");
-    std::chrono::steady_clock::time_point t2 (std::chrono::steady_clock::now());
-    std::chrono::duration<double> dur (t2 - t1);
-    std::cout << GENERATED_IN << dur.count () << std::endl;
-
-    return 0;
-}
+#include "biawebmain.hpp"
+#include <unistd.h>
+using namespace biaweb; 
+int main (int argc, char **argv) {
+    Main prog (argc, argv);
+    return prog.run ();
+}
\ No newline at end of file