From 981df23ea2ae2d1c3ac7c6872bbee34103a9fca8 Mon Sep 17 00:00:00 2001 From: Ava Hahn Date: Mon, 5 Jun 2023 23:32:51 -0700 Subject: [PATCH] flip CFG_RELISH_POSIX behavior Signed-off-by: Ava Hahn --- Readme.org | 6 +++--- Shell.org | 8 -------- src/stl.rs | 4 ++-- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/Readme.org b/Readme.org index e2fb537..a05a683 100644 --- a/Readme.org +++ b/Readme.org @@ -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. ** 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_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 @@ -86,13 +86,13 @@ Compiling Relish is as simple as kicking off a build with Cargo. cargo build #+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 cargo build --no-default-features #+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 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: diff --git a/Shell.org b/Shell.org index cb9d58d..0437761 100644 --- a/Shell.org +++ b/Shell.org @@ -170,11 +170,3 @@ Or: (pacman-search "xfce4") #+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]] diff --git a/src/stl.rs b/src/stl.rs index b18781c..8a37c6d 100644 --- a/src/stl.rs +++ b/src/stl.rs @@ -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. checked at shell startup by configuration daemon. not used afterwards. - default value: false".to_string(), - value: ValueType::VarForm(Box::new(Ctr::Bool(false))), + default value: true".to_string(), + value: ValueType::VarForm(Box::new(Ctr::Bool(true))), ..Default::default() }, );