/** * @file Command.h * @author apio (cloudapio.eu) * @brief Command parsing and execution. * * @copyright Copyright (c) 2024, the Luna authors. * */ #pragma once #include "sh.h" #include #include #include #include struct Command { Vector args; }; Result init_builtins(); Result> read_command(SharedPtr file); Result> parse_command(StringView command); [[noreturn]] void execute_command(OwnedPtr command); [[noreturn]] void execute_command_or_builtin(OwnedPtr command); Result run_builtin(const Vector& args, shell_builtin_t builtin); shell_builtin_t* check_builtin(Command& command); Result execute_command_in_subprocess(OwnedPtr command, SharedPtr input_file, bool interactive);