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

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
paulclinger
Party member
Posts: 227
Joined: Thu Jun 28, 2012 8:46 pm

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

Post 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.
User avatar
dreadkillz
Party member
Posts: 223
Joined: Sun Mar 04, 2012 2:04 pm
Location: USA

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

Post 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.
paulclinger
Party member
Posts: 227
Joined: Thu Jun 28, 2012 8:46 pm

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

Post 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.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post 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.
paulclinger
Party member
Posts: 227
Joined: Thu Jun 28, 2012 8:46 pm

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

Post 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?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

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

Post 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
Help us help you: attach a .love.
paulclinger
Party member
Posts: 227
Joined: Thu Jun 28, 2012 8:46 pm

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

Post 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.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 5 guests