Skip to content

Commit

Permalink
fix(cli): Fix handling of --option flag in Rust CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Oct 16, 2024
1 parent 7006d2c commit 3d4d630
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,15 @@ pub fn run(
has_input_filename = true;
}
if let Some(options) = options {
sile_input.set("options", options)?;
// TODO: when mlua v0.10 merges, adapt this like the uses parsing to avoid chunking
for option in options.iter() {
let option = lua.create_string(option)?;
lua.load(chunk! {
local parameter = SILE.parserBits.parameters:match($option);
SILE.input.options = pl.tablex.merge(SILE.input.options, parameter, true)
})
.eval::<()>()?;
}
}
if let Some(modules) = uses {
// let parser_bits: LuaTable = sile.get("parserBits")?;
Expand Down

0 comments on commit 3d4d630

Please sign in to comment.