diff --git a/Readme.org b/Readme.org index fd8c6d3..5c87a01 100644 --- a/Readme.org +++ b/Readme.org @@ -166,7 +166,6 @@ Note: this section only tracks the state of incomplete TODO items. Having everyt - Can pass args to flesh scripts (via command line) - Can pass args to flesh scripts (via interpreter) - tab completion for symbols also attempts to complete binaries -- cd accepts symbols as well as strings (emulate shell) - declare macros - Release CI - Make an icon if you feel like it diff --git a/Shell.org b/Shell.org index 5b15362..303d90f 100644 --- a/Shell.org +++ b/Shell.org @@ -146,6 +146,10 @@ Flesh also provides a ~cd~ utility to change current working directory: This ~cd~ routine will keep the ~PWD~ variable up to date. Every invokation of ~cd~ will call whatever lambda or function is stored in ~CFG_FLESH_CD_CB~ with no arguments. A function stored in this variable can then perform on the fly reconfiguration or set additional variables based on the directory that the user has entered. +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 + ** Creating bindings for shell commands Daily Flesh users will long for first class shell commands that are accounted for in autocomplete. diff --git a/src/stl/posix.rs b/src/stl/posix.rs index 8c9f47b..6fd6f6a 100644 --- a/src/stl/posix.rs +++ b/src/stl/posix.rs @@ -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 { let dir: &String; match *ast.car {