summaryrefslogtreecommitdiff
path: root/Userland/Shell
AgeCommit message (Collapse)Author
2021-01-25Everywhere: Hook up remaining debug macros to Debug.h.asynts
2021-01-25Everywhere: Remove unnecessary debug comments.asynts
It would be tempting to uncomment these statements, but that won't work with the new changes. This was done with the following commands: find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec awk -i inplace '$0 !~ /\/\/#define/ { if (!toggle) { print; } else { toggle = !toggle } } ; $0 ~/\/\/#define/ { toggle = 1 }' {} \; find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec awk -i inplace '$0 !~ /\/\/ #define/ { if (!toggle) { print; } else { toggle = !toggle } } ; $0 ~/\/\/ #define/ { toggle = 1 }' {} \;
2021-01-23Shell: Run the command's next chain even when it's emptyAnotherTest
2021-01-23Shell: Block on the existing event loop instead of pushing a new oneAnotherTest
This patch makes `Shell::block_on_job()` pump the event loop while the job it's waiting for hasn't finished. As this no longer pushes new event loops, it has the effect of flattening the stack as well. Fixes #4976.
2021-01-23Shell: Make the parser read consecutive sequences without recursingAnotherTest
This fixes (the easy) part of #4976.
2021-01-22Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
2021-01-22Everywhere: Fix typosLinus Groh
2021-01-19Shell: Don't spam perror() on kill_job()AnotherTest
That function is allowed to be given a dead job, so don't bother with perror()
2021-01-19Shell: Make tests use PASS/FAIL instead of exit codesAnotherTest
There's no guarantee that the last executed command will have a zero exit code, and so the shell exit code may or may not be zero, even if all the tests pass. Also changes the `test || echo fail && exit` to `if not test { echo fail && exit }`, since that's nicer-looking.
2021-01-19Shell: Make 'if' expressions return the unevaluated value of blocksAnotherTest
This makes it possible to actually put them in a sequence and cast them to commands.
2021-01-19Shell: Add a `not` builtinAnotherTest
`not` just takes a command, runs it, then negates its exit code (0->1, non-zero->0).
2021-01-19Shell: Mark control structures to be executed in the current processAnotherTest
2021-01-19Shell: Implement `for_each_entry()` for syntactic list nodesAnotherTest
This allows correct iteration over nested lists. Also store values to variables without resolving them, to delay the resolution step as much as possible (this helps with storing nested lists in variables).
2021-01-19Shell: Consider numbers as word characters tooAnotherTest
Otherwise `foobar2` wouldn't be a valid identifier
2021-01-19Shell: Actually return the exit code of the file when running a fileAnotherTest
2021-01-19Shell: Add a builtin that parses its sole argument and dumps its ASTAnotherTest
Pretty useful for debugging.
2021-01-18Shell: Allow newlines between `else` and `if`'s closing braceAnotherTest
This is more flexible and intuitive. Fixes #4992.
2021-01-16Shell: use exit code 127 on command not foundNick Vella
2021-01-16Shell: return the exit code of a '-c' command executionNick Vella
2021-01-15Shell: Add formatter for history eventsAnotherTest
2021-01-15Shell: Add (basic) support for history event designatorsAnotherTest
Closes #4888
2021-01-12LibC+Everywhere: Remove open_with_path_length() in favor of open()Andreas Kling
This API was a mostly gratuitous deviation from POSIX that gave up some portability in exchange for avoiding the occasional strlen(). I don't think that was actually achieving anything valuable, so let's just chill out and have the same open() API as everyone else. :^)
2021-01-12Shell: Use lstat instead of access to check if glob target existsAnotherTest
Fixes #4905
2021-01-12Shell: Move to Userland/Shell/Andreas Kling