Why do both single and double dash engine arguments work?

I couldn't chase down all the history this morning but my recollection is that originally tex had no options. When options were added, eg tex -ini replacing the old separate program initex they were added with one dash.

posix and linux recommend two dashes for multi-letter options and in particular that --help should work with all applications

https://www.gnu.org/prep/standards/html_node/Command_002dLine-Interfaces.html

so as there were no conflicts, the web2c option handling was changed and now accepts one or two dashes in all cases.


LuaTeX in TeX live parses the command line options in luainit.w using getopt_long_only and in its documentation we find

getopt_long_only() is like getopt_long(), but '-' as well as "--" can indicate a long option.

XeTeX and pdfTeX do the same in texmfmp.c I believe.