flip CFG_RELISH_POSIX behavior

Signed-off-by: Ava Hahn <ava@sunnypup.io>
This commit is contained in:
Ava Apples Affine 2023-06-05 23:32:51 -07:00
parent b9414ae4d2
commit 981df23ea2
3 changed files with 5 additions and 13 deletions

View file

@ -62,7 +62,7 @@ Errors during configuration are non-terminal. In such a case any defaults which
- Variables and functions defined during configuration will carry over to the user/script interpreter, allowing the user to load any number of custom functions and variables. - Variables and functions defined during configuration will carry over to the user/script interpreter, allowing the user to load any number of custom functions and variables.
** Configuration Values ** Configuration Values
- CFG_RELISH_POSIX (default false): when true, enables POSIX style job control. - CFG_RELISH_POSIX (default true): when true, enables POSIX style job control and shell features.
- CFG_RELISH_ENV (default true): when true, interpreter's variable table and environment variable table are kept in sync. - CFG_RELISH_ENV (default true): when true, interpreter's variable table and environment variable table are kept in sync.
- CFG_RELISH_L_PROMPT (default 'λ'): a function that is called with no arguments to output the left hand of the prompt - CFG_RELISH_L_PROMPT (default 'λ'): a function that is called with no arguments to output the left hand of the prompt
- CFG_RELISH_R_PROMPT (default ''): a function that is called with no arguments to output the right hand of the prompt - CFG_RELISH_R_PROMPT (default ''): a function that is called with no arguments to output the right hand of the prompt
@ -86,13 +86,13 @@ Compiling Relish is as simple as kicking off a build with Cargo.
cargo build cargo build
#+END_EXAMPLE #+END_EXAMPLE
This will produce a binary at file:target/debug/relish which includes all of the features relish has to offer. This provides a REPL with a full interactive shell that also can manage variables in the Unix environment. It is possible to compile a smaller REPL that does not interact with environment variables and does not offer any shell features. Simply pass the ~--no-default-features~ flag to cargo: This will produce a binary at [[file:target/debug/relish][target/debug/relish]] which includes all of the features relish has to offer. This provides a REPL with a full interactive shell that also can manage variables in the Unix environment. It is possible to compile a smaller REPL that does not interact with environment variables and does not offer any shell features. Simply pass the ~--no-default-features~ flag to cargo:
#+BEGIN_EXAMPLE sh #+BEGIN_EXAMPLE sh
cargo build --no-default-features cargo build --no-default-features
#+END_EXAMPLE #+END_EXAMPLE
In order to run Relish it is recommended to run the resulting binary at file:target/debug/relish. In order to run Relish it is recommended to run the resulting binary at [[file:target/debug/relish][target/debug/relish]].
** Testing ** Testing
Relish has upwards of 120 unit tests. Full functionality of the core AST with lex, parse, and eval routines as well as the symbol table and relevant code can be tested with Cargo. Unit tests are also included for the standard library of data manipulations and special cases around quote/eval and lambda use: Relish has upwards of 120 unit tests. Full functionality of the core AST with lex, parse, and eval routines as well as the symbol table and relevant code can be tested with Cargo. Unit tests are also included for the standard library of data manipulations and special cases around quote/eval and lambda use:

View file

@ -170,11 +170,3 @@ Or:
(pacman-search "xfce4") (pacman-search "xfce4")
#+END_EXAMPLE #+END_EXAMPLE
** Using shell commands in the configuration file
A warning to the reader:
+ the ~.relishrc~ configuration file is loaded before any POSIX shell functions are added
+ direct calls to these functions will throw errors
+ the user can still configure functions and data that relies on shell commands, just not directly
+ lambdas can be used to encapsulate shell commands and run them during the prompt or as shortcuts/functions at the REPL
+ note the examples in this document, as well as [[file:snippets/avas-laptop-prompt.rls][Ava's Laptop Prompt]]

View file

@ -137,8 +137,8 @@ pub fn load_defaults(syms: &mut SymTable) {
docs: "variable holding whether or not POSIX job control functions are to be loaded. docs: "variable holding whether or not POSIX job control functions are to be loaded.
checked at shell startup by configuration daemon. not used afterwards. checked at shell startup by configuration daemon. not used afterwards.
default value: false".to_string(), default value: true".to_string(),
value: ValueType::VarForm(Box::new(Ctr::Bool(false))), value: ValueType::VarForm(Box::new(Ctr::Bool(true))),
..Default::default() ..Default::default()
}, },
); );