Added an init line in sqishrc

This commit is contained in:
Justine Pelletreau
2023-02-21 17:02:10 +01:00
parent c06afb410c
commit 0bf2c601c3
3 changed files with 11 additions and 4 deletions

View File

@ -15,6 +15,7 @@ pub struct SqishConf {
pub promptline_base: String,
pub aliases: HashMap<String, String>,
pub hotkeys: HashMap<String, String>,
pub init: String,
}
impl SqishConf {
@ -42,7 +43,8 @@ impl SqishConf {
};
let sqishrc = &sqishrc[0];
let out_str = String::from(sqishrc["prompt"].as_str().unwrap());
let out_str = String::from(sqishrc["prompt"].as_str().unwrap_or("$ "));
let startup = String::from(sqishrc["init"].as_str().unwrap_or(""));
//Loading hotkeys and aliases from yaml
//They can be empty, be careful...
@ -57,6 +59,7 @@ impl SqishConf {
promptline_base: out_str,
aliases: aliases,
hotkeys: hotkeys,
init: startup,
};
out_conf.handle_rgb();