Closed gvanem closed 1 year ago
It might make sense to print a stripped down version of what's in the Getting Started wiki page, when --help is passed in.
However, since you apparently already read the wiki (where that page says to name your file main.lua and pass in the folder containing the file) before you did something that isn't that, I'm not sure it would have helped you.
We'd also need to be careful to avoid preventing games from implementing their own help arguments, if that's desired.
I agree, but confusing title for this issue. "Support -h/--help cli flags"
I agree, but confusing title for this issue.
Done.
However, since you apparently already read the wiki
I read this: https://love2d.org/wiki/Main_Page which says: Running this code will cause an 800 by 600 window to appear, and display white text on a black background.
It does not mention how. Hence my confusion since I only skimmed some other Wiki pages.
We'd also need to be careful to avoid preventing games from implementing their own help arguments, if that's desired.
This could be a conf.lua setting. Whether to intercept --help.
Running love.exe hello-world.lua
intuitively seems like it should work, and not only does it not work but there's no way to learn from the command line what to do.
(I think that this particular instance of confusion could have been prevented with improved documentation, but my opinions on documentation are beyond the scope of this issue.)
That said, I'm not sure about this proposal.
When would this help message be shown? Only when -h/--help
is passed? What about love.exe hello-world.lua
? If so, this would mean that LOVE project directories couldn't end in ".lua" (or be "-h" for that matter). What about when just love.exe
is run with no arguments? I guess this would still have to run the no-game screen as well, since love.exe could also be run from the OS GUI.
Also, how much information would one want --help
to give? For a command line program, --help
should, if possible, give enough information to use it, but LOVE isn't really a command line program like this; as far as I know it can only be used from the command line in one way: love.exe path-to-project
(or two ways if you count love.exe --version
). I could imagine something like:
Usage: "love <project-folder>", where "project-folder" is a path to a folder containing a file named "main.lua".
It seems to me that any information beyond this would be better presented elsewhere.
But, LOVE kind of already does this with the error message:
Make sure a folder exists at the specified path.
In summary:
love --help
or what information they hope to learn from it exactly.Regarding avoiding preventing games from implementing their own help arguments, does LOVE currently prevent games from implementing their own --version
argument?
We have separate issue tracker for support of opening main.lua
Lua files: #1591
I think we shouldn't intercept --help
after the game path is passed. So, love --help
will show the help information, but love mygame --help
will pass --help
as-is to love.load
for games to handle.
commit 019156e addresses this.
I first heard of Love2D today. Downloading the Win release .zip and trying it required some effort (no real instructions in the
readme.txt
). For example:(same with
love.exe -h
).Reading the Wiki, copy & paste the sample to
hello-world.lua
and runninglovec.exe hello-world.lua
gave me same bleeding stupid Lua call-stack.Then voila renaming
hello-world.lua
tomain.lua
and runninglovec.exe .
gave what I'd expect.How hard should it be? Please handle a
-h
/--help
option like any program with some respect for itself would.