implemented the 'builtin' and 'command' builtins

This commit is contained in:
2025-04-20 16:14:11 -04:00
parent 08e57e92fd
commit 3155db5565
3 changed files with 25 additions and 5 deletions

View File

@@ -25,6 +25,16 @@ pub fn alias(node: Node, io_stack: &mut IoStack, job: &mut JobBldr) -> ShResult<
write(stdout, alias_output.as_bytes())?; // Write it
} else {
for (arg,span) in argv {
if arg == "command" || arg == "builtin" {
return Err(
ShErr::full(
ShErrKind::ExecFail,
format!("alias: Cannot assign alias to reserved name '{arg}'"),
span
)
)
}
let Some((name,body)) = arg.split_once('=') else {
return Err(
ShErr::full(