feat: add initial commands
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user