Website Summary Files Commits Branches @commit @diff @stats
path: root / src / UserInterface / UserInterface.cpp
diff options
context:
space:
mode:
1 files changed, 11 insertions, 0 deletions
-rw-r--r--src/UserInterface/UserInterface.cpp11
diff --git a/src/UserInterface/UserInterface.cpp b/src/UserInterface/UserInterface.cpp
index 4036840..6adc4be 100644
--- a/src/UserInterface/UserInterface.cpp
+++ b/src/UserInterface/UserInterface.cpp
@@ -8,6 +8,16 @@
Table* UserInterface::table = nullptr;
+void UserInterface::com_help(const char* params) {
+ std::cout << "The following commands are supported:" << std::endl
+ << "open <file> opens <file>" << std::endl
+ << "close closes currently opened file" << std::endl
+ << "save saves the currently open file" << std::endl
+ << "saveas <file> saves the currently open file in <file>" << std::endl
+ << "help prints this information" << std::endl
+ << "exit exists the program" << std::endl;
+}
+
void UserInterface::com_print(const char* params) {
List<String> cells = table->getAllCells();
printTable(cells, table->get_cols());
@@ -30,6 +40,7 @@ UserInterface::UserInterface(Table* inTable) : menu() {
if (table == nullptr)
table = inTable;
+ menu.addCommand(Command("help", com_help));
menu.addCommand(Command("print", com_print));
menu.addCommand(Command("edit", com_edit));
}