1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:28:12 +00:00

Shell: Move out run_commands and expand_aliases to be Shell member fns

This makes running commands from outside the AST chain easier.
This commit is contained in:
AnotherTest 2020-07-13 09:30:09 +04:30 committed by Andreas Kling
parent 4c3a415dc3
commit b0ce8d725a
4 changed files with 99 additions and 87 deletions

View file

@ -73,7 +73,8 @@ public:
constexpr static auto global_init_file_path = "/etc/shellrc";
int run_command(const StringView&);
RefPtr<Job> run_command(AST::Command&);
RefPtr<Job> run_command(const AST::Command&);
Vector<RefPtr<Job>> run_commands(Vector<AST::Command>&);
bool run_file(const String&, bool explicitly_invoked = true);
bool run_builtin(int argc, const char** argv, int& retval);
bool has_builtin(const StringView&) const;
@ -83,6 +84,7 @@ public:
static String expand_tilde(const String&);
static Vector<String> expand_globs(const StringView& path, StringView base);
static Vector<String> expand_globs(Vector<StringView> path_segments, const StringView& base);
Vector<AST::Command> expand_aliases(Vector<AST::Command>);
String resolve_path(String) const;
String resolve_alias(const String&) const;