mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 19:29:16 +00:00
Shell: Add a 'setopt' builtin
This builtin sets (and unsets) boolean flags that alter the behaviour of the shell. The only flags added are - inline_exec_keep_empty_segments: Keep empty segments in the result of splitting $(...) by $IFS - verbose: Announce each command before executing it It should be noted that the (rather extreme) verbosity of the names is intentional, and will hopefully be alleviated by the next commit :^)
This commit is contained in:
committed by
Andreas Kling
parent
d6de2b5828
commit
b8d1edb2a2
@@ -356,6 +356,14 @@ RefPtr<Job> Shell::run_command(AST::Command& command)
|
||||
{
|
||||
FileDescriptionCollector fds;
|
||||
|
||||
if (options.verbose) {
|
||||
fprintf(stderr, "+ ");
|
||||
for (auto& arg : command.argv)
|
||||
fprintf(stderr, "%s ", escape_token(arg).characters());
|
||||
fprintf(stderr, "\n");
|
||||
fflush(stderr);
|
||||
}
|
||||
|
||||
// Resolve redirections.
|
||||
NonnullRefPtrVector<AST::Rewiring> rewirings;
|
||||
for (auto& redirection : command.redirections) {
|
||||
|
||||
Reference in New Issue
Block a user