CLI: startInteractive(): Handle bad()/eof()
This commit is contained in:
parent
95c5c4e155
commit
57c28b2426
10
cli.cpp
10
cli.cpp
@ -205,6 +205,16 @@ void CLI::startInteractive()
|
|||||||
std::cout << "> ";
|
std::cout << "> ";
|
||||||
std::getline(std::cin, input);
|
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+");
|
std::vector<std::string> splitted = utils::split(input, "\\s+");
|
||||||
if(splitted.empty())
|
if(splitted.empty())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user