croissant icon indicating copy to clipboard operation
croissant copied to clipboard

Change printed banner to print only Lua version.

Open averms opened this issue 4 years ago • 5 comments

This fixes #6.

averms avatar Oct 22 '21 17:10 averms

Actually I think the format of the banner looks a little uneven:

🥐  Croissant 0.0.1 (C) 2019 Benoit Giannangeli
LuaJIT 2.1.0-beta3
→

I think it might be better to have the version in the same line. Maybe like:

🥐 Croissant 0.0.1 (C) 2019 Benoit Giannangeli (LuaJIT 2.1.0-beta3)
→

averms avatar Oct 22 '21 17:10 averms

Thanks for the patch. The only issue I see is that, jit or _VERSION could be either absent or modified. Aso, I think we still need to print the copyright info.

giann avatar Oct 25 '21 05:10 giann

The only issue I see is that, jit or _VERSION could be either absent or modified.

On startup of the interpreter it should be there, right? Obviously once the user starts executing code they can do whatever but this is a banner that prints at startup. I've never used croissant as a debugger so maybe I'm missing something there. There's no other way to programmatically get the Lua version from inside Lua unless you write a C extension that #includes lua.h.

Aso, I think we still need to print the copyright info

Not sure it's possible to print out the copyright info with correct years programmatically unless you write a C extension or parse lua.h.

As for the legal side, I'm not a lawyer but the MIT license requirement for copyright attribution is for "all copies or substantial portions of the Software.", which I don't think this is.

averms avatar Oct 25 '21 18:10 averms

I also note that the existing behaviour doesn't work in Lua 5.4:

$ croissant
🥐  Croissant 0.0.1 (C) 2019 Benoit Giannangeli
Lua 5.3 Copyright (C) 1994-2018 Lua.org, PUC-Rio
→ _VERSION
"Lua 5.4"	

daurnimator avatar Mar 04 '22 05:03 daurnimator

Yes it's totally untested with 5.4

giann avatar Mar 04 '22 06:03 giann