feat: add initial commands

This commit is contained in:
2024-03-15 00:53:58 +00:00
parent 1e39cc3431
commit c84f02f741
+15
View File
@@ -2,9 +2,24 @@
#include "CalculatorCli.hpp" #include "CalculatorCli.hpp"
constexpr std::array kInitialCommands{
std::string_view{"a = 2 + 3"},
std::string_view{"b = e - 2"},
std::string_view{"c = 1 + 2"},
std::string_view{"d = e / 3"},
std::string_view{"e = a + c"},
std::string_view{"f = 3 + 4"},
std::string_view{"undo 2"},
std::string_view{"e = 2 + 2"},
std::string_view{"f = g * 7"},
};
auto main() -> int auto main() -> int
{ {
CalculatorCli cli; CalculatorCli cli;
for (const auto commands : kInitialCommands) {
cli.parse(commands);
}
cli.runLoop(); cli.runLoop();
return 0; return 0;
} }