cd path arg can be a symbol (shell ease)

Signed-off-by: Ava Affine <ava@sunnypup.io>
This commit is contained in:
Ava Apples Affine 2024-02-20 14:32:06 -08:00
parent 50ebfd2e37
commit 108e25e336
3 changed files with 9 additions and 3 deletions

View file

@ -715,9 +715,12 @@ fn fg_callback(
}
const CD_DOCSTRING: &str =
"Expects 1 argument (a string). Changes to a new directory.
"Expects 1 argument (a string, symbol, or form). Changes to a directory.
WARNING: Symbols will be taken as strings unless wrapped in a form.
> Example: cd HOME => cd 'HOME'
> Example: cd (eval HOME) => cd /path/to/home/dir
If CFG_RELISH_CD_CB is defined, cd will evaluate it.
cd returns the result that CFG_RELISH_CD_CB returns.";
cd returns the result that CFG_RELISH_CD_CB returns, or None";
fn cd_callback(ast: &Seg, syms: &mut SymTable) -> Result<Ctr, Traceback> {
let dir: &String;
match *ast.car {