shopt now prints current values if no args are given

This commit is contained in:
2026-02-27 10:07:45 -05:00
parent ea8539c929
commit e141e39c7e
2 changed files with 25 additions and 5 deletions

View File

@@ -83,6 +83,15 @@ impl ShOpts {
}
}
pub fn display_opts(&mut self) -> ShResult<String> {
let output = [
format!("core:\n{}", self.query("core")?.unwrap_or_default()),
format!("prompt:\n{}",self.query("prompt")?.unwrap_or_default())
];
Ok(output.join("\n"))
}
pub fn set(&mut self, opt: &str, val: &str) -> ShResult<()> {
let mut query = opt.split('.');
let Some(key) = query.next() else {