mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-03-06 13:35:03 +00:00
Shell: Show a snippet of what caused the error (if possible)
Now we can have nice errors too: ``` Shell: Glob did not match anything! 0| echo ?x ~~~~~~~~~~^^ 1| ```
This commit is contained in:
committed by
Andreas Kling
parent
3d51bcaa4e
commit
a698af88fc
@@ -866,10 +866,12 @@ bool Shell::run_builtin(const AST::Command& command, const NonnullRefPtrVector<A
|
||||
Core::EventLoop loop;
|
||||
setup_signals();
|
||||
|
||||
#define __ENUMERATE_SHELL_BUILTIN(builtin) \
|
||||
if (name == #builtin) { \
|
||||
retval = builtin_##builtin(argv.size() - 1, argv.data()); \
|
||||
return true; \
|
||||
#define __ENUMERATE_SHELL_BUILTIN(builtin) \
|
||||
if (name == #builtin) { \
|
||||
retval = builtin_##builtin(argv.size() - 1, argv.data()); \
|
||||
if (!has_error(ShellError::None)) \
|
||||
raise_error(m_error, m_error_description, command.position); \
|
||||
return true; \
|
||||
}
|
||||
|
||||
ENUMERATE_SHELL_BUILTINS();
|
||||
|
||||
Reference in New Issue
Block a user