Website Summary Files Commits Branches @commit @diff @stats
path: root / src / UserInterface / UserInterface.cpp
diff options
context:
space:
mode:
Commit0030194fbcae758068ddbcb8cebfdd5beb76cf4d (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-05-30 18:17:42 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-05-30 18:17:42 +0300
Files119b69bed51b5613127bcb4a94c64adcdfcc3c60 /src/UserInterface/UserInterface.cpp
FMI-OOP-P2_Tables-0030194fbcae758068ddbcb8cebfdd5beb76cf4d.tar
FMI-OOP-P2_Tables-0030194fbcae758068ddbcb8cebfdd5beb76cf4d.tar.gz
FMI-OOP-P2_Tables-0030194fbcae758068ddbcb8cebfdd5beb76cf4d.zip
Parentaecbafe786a451c202c867d0ce6cb92e7a76a5be (diff)
Autocommit at 30.05.2022 @ 18:17
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));
}