Page 1 of 1

Can Love execute code fragments with an option (like -e)?

Posted: Mon Jul 02, 2012 10:35 pm
by paulclinger
Hi All,

I'd like to be able to execute a code fragment in addition to providing a folder or a file name. I couldn't find any way to provide an option similar to "lua -e" to the love executable. This would be a very useful option to configure debuggers, profiliers, and other components without modifying the source code of main.lua.

Is it already available or can it being considered as a future enhancement?

Paul.

Re: Can Love execute code fragments with an option (like -e)

Posted: Tue Jul 03, 2012 1:57 am
by dreadkillz
I'm not sure if this is what you're looking for, but you can run Love with a console: https://love2d.org/wiki/Debug.
From there you can load, inspect or execute whatever codes you want without affecting your files.

Re: Can Love execute code fragments with an option (like -e)

Posted: Tue Jul 03, 2012 2:23 am
by paulclinger
@dreadkillz, it's not quite that; I have seen various console modules, but they still require code changes to be enabled. I'm looking for a way to change execution without code changes.

Re: Can Love execute code fragments with an option (like -e)

Posted: Tue Jul 03, 2012 7:49 am
by bartbes
It's not possible at the moment, it is however a small code change if you can/want to use a modified version of love.

Re: Can Love execute code fragments with an option (like -e)

Posted: Tue Jul 03, 2012 7:41 pm
by paulclinger
bartbes wrote:It's not possible at the moment, it is however a small code change if you can/want to use a modified version of love.
Any plans to implement this? I prefer to use the standard version of love. Just in case, where would I make the change? boot.lua.h?

Re: Can Love execute code fragments with an option (like -e)

Posted: Tue Jul 03, 2012 10:08 pm
by Robin
That would be "boot.lua".

"boot.lua.h" is automatically generated from the former by running:

Code: Select all

lua auto.lua boot

Re: Can Love execute code fragments with an option (like -e)

Posted: Tue Jul 03, 2012 10:42 pm
by paulclinger
Thanks Robin; found it in the repo: https://bitbucket.org/rude/love/src/3cb ... s/boot.lua. For some reason it wasn't in the source archive.