Topic: What, if any, command line options are there?
Casteele Topic Opener |
Posted at: 2022-12-16, 04:27
While messing around with several things (modding, customization, debugging/tracing), I came across some issues... Because of the way the Debian Linux package is distributed as a FlatPak, I have to write some custom commands to launch both the FlatPak launcher and the game itself. This requires me to do a song-and-dance to properly get the different log files (i.e., one log for the FlatPak launcher, another log for WL itself...) What command line options, if any, exist in the Widelands binary? Ideally, I hope there are some to control logging output, such as "to a file", and logging levels, such as "info, warnings, errors, fatal". Top Quote |
niektory |
Posted at: 2022-12-16, 07:03
Running
Edited: 2022-12-16, 07:04
Top Quote |
Casteele Topic Opener |
Posted at: 2022-12-16, 09:25
Thank you. Being a FlatPak made it difficult to execute the binary with "--help-all" and still see the output. I finally managed it, but maybe there should be a Wiki entry listing the options (at least the common and important ones), somewhere. (I might do it, myself, and submit it. Depends on my available time...) Top Quote |
mxb2001 |
Posted at: 2022-12-18, 22:16
This may not be useful but since I've had some problems myself with flatpak and logging I'll just submit an example of what I did with another game: /usr/bin/flatpak run --branch=stable org.wesnoth.Wesnoth --log-none deprecation >weslog16.txt 2>&1 The first option is for flatpack. org.w.W is sort of the game executable and is followed by a option as well as a pipe for the log. -- |
tothxa |
Posted at: 2022-12-19, 01:33
Actually flatpak doesn't normally write anything on stdout. But if you want to do special things, you may consider doing them from inside the flatpak runtime: BTW there IS a real Debian package. v1.1 is in unstable: https://packages.debian.org/widelands Top Quote |
Casteele Topic Opener |
Posted at: 2022-12-19, 09:52
I think I have things figured out. To document it all, I am posting here the issues and solutions that worked for me. First issue, WL is distributed in the upstream repository, but the build is either months or years out-of-date. The only way around this is to either compile it myself (another issue in itself...), or download it from the WL website. But... Second issue, reasonably up-to-date versions of WL are distributed as a FlatPak for my operating system. This caused several issues because FlatPak creates a separate runtime environment (a chroot jail type thing) for the game, where common techniques such as direct command line starting of the game, input/out redirection, and even using specialized commands/tools/shell scripts do not work normally. FlatPak's are not very well documented, either (there exists a lot of documentation--but frankly, it sucks). To get around this, I wrote a custom script (in TCL, but I could have used Perl, Python, etc) that let me type just "wl [options]", where my script would create a proper FlatPak command line to properly launch WL with the desired options. It would also handle properly setting up I/O redirection and log files. Third issue, under my default GUI desktop (X11+Gnome+KDE), the *.desktop launcher+FlatPak acted weird: I could edit the application, but it ignored my edits. At one point, I even set the target application in the *.desktop to literally execute the command "argh die die die" -- This should have caused it to fail executing at all when click the launcher icon/menu. However, it still launched WL as if I never edited it at all. I suspect this is something with how FlatPak sets things up, and has nothing to do with WL itself. But the problem was that it would not execute my custom written "wl [options]" command. To get around this, I renamed my "/usr/bin/flatpak" command to "/usr/bin/flatpak.real", and then set up another script as "/usr/bin/flatpak". This script would parse the command line options, change them as needed, then pass them on to the "flatpak.real" command. (I needed this because WL is not the only FlatPak app on my system; I also have DOSBOX-X). Fourth issue, both WL Stable (ver. 1.1) and WL Beta (ver. 1.2) are installed on my system. To choose which to execute, I modified my "wl" script to select the proper "--branch=..." to tell FlatPak to use. I might have forgotten some more minor issues, but I finally got everything working, logging, etc. If there is enough interest, I might consider contributing my scripts, or maybe better... Developing a WL launcher similar to the MineCraft launcher, which can can detect and choose different base installations, etc... Hard to say right now since my free time is in flux due to the holiday season. Top Quote |