CLI: startInteractive(): Handle bad()/eof()

This commit is contained in:
Albert S. 2021-09-26 17:33:46 +02:00
γονέας 95c5c4e155
υποβολή 57c28b2426
1 αρχεία άλλαξαν με 10 προσθήκες και 0 διαγραφές

10
cli.cpp

@ -205,6 +205,16 @@ void CLI::startInteractive()
std::cout << "> ";
std::getline(std::cin, input);
if(std::cin.bad() || std::cin.eof())
{
std::cout << "Exiting" << std::endl;
return;
}
if(input.empty())
{
continue;
}
std::vector<std::string> splitted = utils::split(input, "\\s+");
if(splitted.empty())
{