Rewrite builtin functions in rust

This commit is contained in:
Fabian Boehm
2023-08-08 20:12:05 +02:00
parent 5e78cf8c41
commit 6489ef5ac0
7 changed files with 473 additions and 1 deletions

View File

@@ -373,7 +373,7 @@ static constexpr builtin_data_t builtin_datas[] = {
{L"fg", &builtin_fg, N_(L"Send job to foreground")},
{L"for", &builtin_generic, N_(L"Perform a set of commands multiple times")},
{L"function", &builtin_generic, N_(L"Define a new function")},
{L"functions", &builtin_functions, N_(L"List or remove functions")},
{L"functions", &implemented_in_rust, N_(L"List or remove functions")},
{L"history", &builtin_history, N_(L"History of commands executed by user")},
{L"if", &builtin_generic, N_(L"Evaluate block if condition is true")},
{L"jobs", &builtin_jobs, N_(L"Print currently running jobs")},
@@ -549,6 +549,9 @@ static maybe_t<RustBuiltin> try_get_rust_builtin(const wcstring &cmd) {
if (cmd == L"exit") {
return RustBuiltin::Exit;
}
if (cmd == L"functions") {
return RustBuiltin::Functions;
}
if (cmd == L"math") {
return RustBuiltin::Math;
}

View File

@@ -123,6 +123,7 @@ enum class RustBuiltin : int32_t {
Echo,
Emit,
Exit,
Functions,
Math,
Path,
Printf,