skip over spaces and tabs to find a command fed to it, and find the end of the command by looking for both spaces and tabs
Some checks failed
Build library / Clang Tidy (push) Has been cancelled
Build library / ASAN (push) Has been cancelled
Build library / Linux Ubuntu 22.04 (push) Has been cancelled
Build library / macOS 11 (push) Has been cancelled
Build library / Windows 2019 (push) Has been cancelled
Build library / Source code archive (push) Has been cancelled
Build library / Linux libsndfile (push) Has been cancelled
Build library / Linux makefile (push) Has been cancelled
Build library / deploy (push) Has been cancelled
Some checks failed
Build library / Clang Tidy (push) Has been cancelled
Build library / ASAN (push) Has been cancelled
Build library / Linux Ubuntu 22.04 (push) Has been cancelled
Build library / macOS 11 (push) Has been cancelled
Build library / Windows 2019 (push) Has been cancelled
Build library / Source code archive (push) Has been cancelled
Build library / Linux libsndfile (push) Has been cancelled
Build library / Linux makefile (push) Has been cancelled
Build library / deploy (push) Has been cancelled
This commit is contained in:
parent
c52e2d6f33
commit
f5c6e29f23
1 changed files with 3 additions and 2 deletions
|
|
@ -221,13 +221,14 @@ std::vector<std::string> stringTokenize(const std::string& str)
|
|||
|
||||
void cliThreadProc()
|
||||
{
|
||||
const std::string whitespace = " \t";
|
||||
while (!shouldClose) {
|
||||
std::cout << "\n> ";
|
||||
|
||||
std::string command;
|
||||
std::getline(std::cin, command);
|
||||
std::size_t start = command.length()? command.find_first_not_of(" "): 0;
|
||||
std::size_t pos = command.find(" ", start);
|
||||
std::size_t start = command.length()? command.find_first_not_of(whitespace): 0;
|
||||
std::size_t pos = command.find_first_of(whitespace, start);
|
||||
std::string kw = command.substr(start, pos - start);
|
||||
std::string args = command.substr(pos + 1);
|
||||
std::vector<std::string> tokens = stringTokenize(args);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue