About the Lix commands/switches

Started by Forestidia86, February 15, 2018, 09:32:57 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Forestidia86

I just played sporadically around with the Lix switches (Win7, Lix 0.9.11):

--fullscreen doesn't seem to change anything for me (the game starts though with my predefined mode (window 800x600)). The other switches concerning resolution seem to work though.
-> Edit Simon: This is now fixed in mid-2018.

If I use something like -h or -v the cmd prompt seems to show nothing but if I redirect output to a file the textfile for the standard output shows text. Can somebody explain why this happens?
-> Edit Simon: From console suppression, see below in this post.

Simon

Yeah, --fullscreen doesn't do anything. It's a bug. This likely got introduced from allowing resolution switches during options/main menu.

-h and --help explain the command-line switches and --version prints the version of the program to the console. Especially --version is good style to have on any Linux program. All information from these switches is accessible some other way, you're never forced to use these.

-- Simon

Forestidia86

#2
Cause of the problem with e.g. -h switch in Win seems to be lifted:

From IRC:
[20:34]<@SimonN> I have a hot theory now. We actively close stdout during compilation to suppress a console window on Windows that would normally open
[20:34] <@SimonN> examine dub.json and remove this line:     "lflags-windows": ["-L/subsystem:windows"],
[20:35] <Forestidia> Can I outcomment it somehow?
[20:35] <@SimonN> then rebuild (dub) and see if stdout works. Downside is that even double-clicking Lix in the file browser will spawn a console that will be empty
[20:36] <@SimonN> you can rename "lflags-windows" to "COMMENTED-OUT-lflags-windows" or anything else, such that it doesn't match anymore what the build system expects
[20:36] <@SimonN> sadly, no comments in JSON file format, a common complaint
[20:38] <Forestidia> Yeah works.
[20:38] <@SimonN> okay, then we have the answer. I instruct the linker to produce a Windows binary with stdout closed
[20:39] <Forestidia> But I think to not have the extra window is more important.
[20:39] <@SimonN> yeah, if we can only have one or the other behavior, no console window is preferred
[20:39] <@SimonN> and you can still redirect, which is nice

So if you build yourself in Win you can decide if you want the switches to work properly but therefore have every time you start Lix an empty console window spawned. Or if you don't want the extra console window and rather use redirecting arrows (>) if you want the information from the switches.
The second option generally seems to be preferable since you rarely need the information of the switches anyways and still have the possibility to redirect.

Example for redirecting:
lix -h > a.txt

This puts the help output in a txt-file called a.txt, which is generally created in the directory where you execute the command line. 

Note: > overwrites each time you use it if you want to keep the old results in the file use the double arrow >>.