move m_curDir to the parser class
Change-Id: Ib3cf15dfbb7af861a3c2fa8e746a0b0baaaa512e
diff --git a/src/main.cpp b/src/main.cpp
index 68ddbef..607115e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -35,7 +35,7 @@
using x3::lexeme;
using ascii::space;
-void interpret(cd_ command, CTree& tree)
+void interpret(cd_ command, CParser& tree)
{
tree.changeNode(command.m_path);
}
@@ -62,7 +62,7 @@
CParser parser(tree);
while (true) {
- std::cout << tree.currentNode() << ">";
+ std::cout << parser.currentNode() << ">";
std::string input;
std::getline(std::cin, input);
if (std::cin.eof())
@@ -70,7 +70,7 @@
try {
cd_ command = parser.parseCommand(input, std::cout);
- interpret(command, tree);
+ interpret(command, parser);
} catch (InvalidCommandException& ex) {
std::cerr << ex.what() << std::endl;
}