Commit Graph

6 Commits

Author SHA1 Message Date
AnotherTest
ff857cd358 Shell: Initial support for 'option' completions
Take one small step towards #2357.
Handle completing barewords starting with '-' by piping the requests to
the Shell::complete_option(program_name, option) :^)

Also implements completion for a single builtin (setopt) until we figure out how
to handle #2357.
2020-07-05 15:43:14 +02:00
AnotherTest
b8d1edb2a2 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 :^)
2020-07-05 15:43:14 +02:00
AnotherTest
639c1a1737 Shell: Build as part of Lagom as well
Bringing the Serenity Shell to your very own host system :^)
2020-07-05 15:43:14 +02:00
AnotherTest
16def040af Shell: Do not try to recreate a command from a list of args in time
Shell already provides a run_command(AST::Command) which can be
constructed from a list of arguments, use that instead.
2020-07-05 15:43:14 +02:00
AnotherTest
2915dcfcc3 Shell: Add the alias builtin and resolve aliases
This follows the other shells in alias resolution, and resolves the
alias only once.
2020-07-05 15:43:14 +02:00
AnotherTest
a4627f2439 Shell: Switch to a new parser and AST
This commit also completely reworks the execution, highlighting and
completion model to work with the new AST.
New additions:
- $(...) stdout captures
- fd>&fd redirections
- fd>&- redirections (close fd)
- read-write redirections (<> path)
- completely event-based execution
- the weird idea of allowing the user to redirect the shell's own fds
- variables in strings
- local variables
- minimal list support
- adding hyperlinks to all paths that exist
2020-07-05 15:43:14 +02:00