Closed sonic2kk closed 4 months ago
Tested and this works with the following GameScope arg strings:
-w 1280 -h 720 -W 1280 -H 720 -f --
- valid args with --
at the end as it should normally be by default, and also when edited from the GameScope GUI.-w 1280 -h 720 -W 1280 -H 720 -f
- valid args, but missing --
at the end, so invalid syntax. This kind of case would only arise if the args were manually entered/edited. This PR catches this case and appends --
at the end.none
- This is what actually gets saved to GAMESCOPE_ARGS
config var if the args are blank after saving, but this was tested with the above by going to the Game Menu -> Deleting all GameScope args so the textbox was blank -> Save and Play (success) -> Close and relaunch game -> Go to Game Menu -> GameScope args were none
-> Save and Play (success).I tested the arguments with a ton of whitespaces and they do break, but I think it's up to the user to make sure they format the args correctly. Appending --
is just a convenience, trying to handle formatting the spacing between flags would add a lot of complexity especially when it comes to paths. So for now, we will leave this.
Now that testing is done, this is ready to merge after a version bump.
Fixes #1048. Follow-up to #1049.
Very similar to #1049, except this handles the case where the given GameScope arguments string that we want to break up into
GAMESCOPEARGSARR
(which ultimately gets passed to the launch command) does not end with--
. This causes the same problem as if the arguments are blank: the GameScope command is not properly terminated.ShellCheck is good on this at time of writing but I want to do some more testing (such as with whitespaces and such after the args string to see how we handle that).