summaryrefslogtreecommitdiff
path: root/Shell/Shell.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Shell/Shell.cpp')
-rw-r--r--Shell/Shell.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Shell/Shell.cpp b/Shell/Shell.cpp
index 4909b3e8b9..a7cfbcaaae 100644
--- a/Shell/Shell.cpp
+++ b/Shell/Shell.cpp
@@ -361,19 +361,19 @@ int Shell::run_command(const StringView& cmd)
if (!command)
return 0;
+#ifdef SH_DEBUG
+ dbg() << "Command follows";
+ command->dump(0);
+#endif
+
if (command->is_syntax_error()) {
auto& error_node = command->syntax_error_node();
auto& position = error_node.position();
fprintf(stderr, "Shell: Syntax error in command: %s\n", error_node.error_text().characters());
- fprintf(stderr, "Around '%.*s'\n", (int)min(position.end_offset - position.start_offset, (size_t)10), cmd.characters_without_null_termination() + position.start_offset);
+ fprintf(stderr, "Around '%.*s' at %zu:%zu\n", (int)min(position.end_offset - position.start_offset, (size_t)10), cmd.characters_without_null_termination() + position.start_offset, position.start_offset, position.end_offset);
return 1;
}
-#ifdef SH_DEBUG
- dbg() << "Command follows";
- command->dump(0);
-#endif
-
tcgetattr(0, &termios);
auto result = command->run(*this);