cd function

Signed-off-by: Ava Hahn <ava@sunnypup.io>
This commit is contained in:
Ava Apples Affine 2023-04-17 22:11:49 -07:00
parent db55c54dd3
commit ee1ef9700d
Signed by: affine
GPG key ID: 3A4645B8CF806069
6 changed files with 87 additions and 33 deletions

View file

@ -648,6 +648,17 @@ pub fn dynamic_stdlib(syms: &mut SymTable, shell: Option<Rc<RefCell<posix::Shell
if posix_cfg_user_form {
posix::load_posix_shell(syms, shell_state);
syms.insert(
"cd".to_string(),
Symbol {
name: String::from("cd"),
args: Args::Strict(vec![Type::String]),
conditional_branches: false,
docs: posix::CD_DOCSTRING.to_string(),
value: ValueType::Internal(Rc::new(posix::cd_callback)),
..Default::default()
},
);
}
}