improvements to configuration system
This commit is contained in:
parent
bfd1058ad7
commit
8a91560921
3 changed files with 15 additions and 15 deletions
|
|
@ -393,8 +393,8 @@ 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 0): when on, enables POSIX style job control.
|
- CFG_RELISH_POSIX (default false): when true, enables POSIX style job control.
|
||||||
- CFG_RELISH_ENV (default 1): when on, 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_PROMPT (default (echo "λ ")): A *function* definition which is called in order to output the prompt for each loop of the REPL.
|
- CFG_RELISH_PROMPT (default (echo "λ ")): A *function* definition which is called in order to output the prompt for each loop of the REPL.
|
||||||
This function will be reloaded each REPL loop and will be called by the interpreter with no arguments.
|
This function will be reloaded each REPL loop and will be called by the interpreter with no arguments.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,19 +29,19 @@ fn prompt_default_callback(_: &Seg, _: &mut SymTable) -> Result<Ctr, String> {
|
||||||
|
|
||||||
/* loads defaults, evaluates config script */
|
/* loads defaults, evaluates config script */
|
||||||
pub fn configure(filename: String, syms: &mut SymTable) -> Result<(), String> {
|
pub fn configure(filename: String, syms: &mut SymTable) -> Result<(), String> {
|
||||||
/*syms.insert(
|
syms.insert(
|
||||||
"CFG_RELISH_POSIX".to_string(),
|
"CFG_RELISH_POSIX".to_string(),
|
||||||
Symbol {
|
Symbol {
|
||||||
name: String::from("CFG_RELISH_POSIX"),
|
name: String::from("CFG_RELISH_POSIX"),
|
||||||
args: Args::None,
|
args: Args::None,
|
||||||
conditional_branches: false,
|
conditional_branches: false,
|
||||||
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: not set".to_string(),
|
default value: false".to_string(),
|
||||||
value: ValueType::VarForm(Box::new(Ctr::String("0".to_string()))),
|
value: ValueType::VarForm(Box::new(Ctr::Bool(false))),
|
||||||
},
|
},
|
||||||
);*/
|
);
|
||||||
|
|
||||||
syms.insert(
|
syms.insert(
|
||||||
"CFG_RELISH_ENV".to_string(),
|
"CFG_RELISH_ENV".to_string(),
|
||||||
|
|
@ -55,7 +55,7 @@ checked at shell startup by configuration daemon. not used afterwards.
|
||||||
|
|
||||||
default value: 1 (set)
|
default value: 1 (set)
|
||||||
".to_string(),
|
".to_string(),
|
||||||
value: ValueType::VarForm(Box::new(Ctr::String("1".to_string()))),
|
value: ValueType::VarForm(Box::new(Ctr::Bool(true))),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -548,7 +548,7 @@ pub fn dynamic_stdlib(syms: &mut SymTable) -> Result<(), String> {
|
||||||
.call_symbol(&"CFG_RELISH_ENV".to_string(), &Seg::new(), true)
|
.call_symbol(&"CFG_RELISH_ENV".to_string(), &Seg::new(), true)
|
||||||
.unwrap_or_else(|_: String| Box::new(Ctr::None))
|
.unwrap_or_else(|_: String| Box::new(Ctr::None))
|
||||||
.to_string()
|
.to_string()
|
||||||
.ne("");
|
.eq("true");
|
||||||
|
|
||||||
syms.insert(
|
syms.insert(
|
||||||
"def".to_string(),
|
"def".to_string(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue