Skip to content

Commit a77170e

Browse files
committed
fix(cli): Fix handling of --option flag in Rust CLI
1 parent 6128b33 commit a77170e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/lib.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,15 @@ pub fn run(
133133
has_input_filename = true;
134134
}
135135
if let Some(options) = options {
136-
sile_input.set("options", options)?;
136+
// TODO: when mlua v0.10 merges, adapt this like the uses parsing to avoid chunking
137+
for option in options.iter() {
138+
let option = lua.create_string(option)?;
139+
lua.load(chunk! {
140+
local parameter = SILE.parserBits.parameters:match($option);
141+
SILE.input.options = pl.tablex.merge(SILE.input.options, parameter, true)
142+
})
143+
.eval::<()>()?;
144+
}
137145
}
138146
if let Some(modules) = uses {
139147
// let parser_bits: LuaTable = sile.get("parserBits")?;

0 commit comments

Comments
 (0)