mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
If possible all errors are sent to stderr
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1055 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -69,6 +69,7 @@ void CLISetInterface::run() {
|
||||
running = true;
|
||||
while (running) {
|
||||
if (!cli.canGetLine()) break;
|
||||
handle_pending_errors();
|
||||
// show prompt
|
||||
if (!quiet) {
|
||||
cli << GRAY << _("> ") << NORMAL;
|
||||
@@ -153,7 +154,7 @@ void CLISetInterface::handleCommand(const String& command) {
|
||||
vector<ScriptParseError> errors;
|
||||
ScriptP script = parse(command,nullptr,false,errors);
|
||||
if (!errors.empty()) {
|
||||
FOR_EACH(error,errors) showError(error.what());
|
||||
FOR_EACH(error,errors) cli.showError(error.what());
|
||||
return;
|
||||
}
|
||||
// execute command
|
||||
@@ -164,10 +165,6 @@ void CLISetInterface::handleCommand(const String& command) {
|
||||
cli << result->toCode() << ENDL;
|
||||
}
|
||||
} catch (const Error& e) {
|
||||
showError(e.what());
|
||||
cli.showError(e.what());
|
||||
}
|
||||
}
|
||||
|
||||
void CLISetInterface::showError(const String& error) {
|
||||
cli << RED << _("ERROR: ") << NORMAL << replace_all(error,_("\n"),_("\n ")) << ENDL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user