sile-typesetter / sile

The SILE Typesetter — Simon’s Improved Layout Engine
https://sile-typesetter.org
MIT License
1.67k stars 98 forks source link

Regression on the -O command line option? #2132

Closed Omikhleia closed 4 weeks ago

Omikhleia commented 4 weeks ago

From the help: -O, --option <OPTION> Set or override document class options

$ sile -Opapersize=a6 papersz.sil
SILE v0.15.5 (LuaJIT 2.1.1727870382) [Rust]
[1] 

Expected: A6 Observed: A4

For the record input document is dumb:

\begin{document}
Test page size
\end{document}
alerque commented 4 weeks ago

First, the correct usage should have a space:

$ sile -O papersize=a6 papersz.sil

...but that isn't the issue because as you note it still doesn't have any effect. So far all I have is:

  1. It does work in the legacy Lua based CLI: sile-lua -O papersize=a6 papersz.sil
  2. The long option for this is different between the Rust and Lua CLIs, it is --option in the Rust CLI parser and --options in the legacy Lua parser. As far as I know we didn't announce that as a breaking change so that's a bug too. My goal was to keep them being as close to interchangeable as possible until we dropped the Lua one entirely.
alerque commented 4 weeks ago

On the latter point, it looks like I was trying to clean up the singular vs. plural flag situation. Given the way the Rust CLI handles multiple flags (--option a=b --option x=y or --option a=b,x=y) the singulars are probably okay (also for --debug, --use, --evaluate, --evaluate-after, --preamble, ond --postambe), but I can add ad alias for --options so the CLIs are interchangeable for convenience for now.