return E_FAIL;
}
- return execCommands(FileLineReader(std::move(file)));
+ return execCommands(FileLineReader(std::move(file)), true);
}
}
-HRESULT CLIProtocol::execCommands(LineReader&& lr)
+HRESULT CLIProtocol::execCommands(LineReader&& lr, bool printCommands)
{
// preserve currently existing line reader and restore it on exit
auto restorer = [&](LineReader* save) { line_reader = save; };
};
LOGD("executing: '%.*s'", int(input.size()), input.data());
+
+ if (printCommands) {
+ printf("%s\n", input.data());
+ }
line_reader->setLastCommand(input);
auto unparsed = CommandsList::cli_helper.eval(input, handler);
if (!have_result)
// This function interprets commands from the input till reaching Eof or Error.
// Function returns E_FAIL in case of input error.
- HRESULT execCommands(LineReader&&);
+ HRESULT execCommands(LineReader&&, bool printCommands = false);
// update screen (after asynchronous message printed)
void repaint();