cd function
Signed-off-by: Ava Hahn <ava@sunnypup.io>
This commit is contained in:
parent
db55c54dd3
commit
ee1ef9700d
6 changed files with 87 additions and 33 deletions
11
src/stl.rs
11
src/stl.rs
|
|
@ -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()
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue