Core, BizHawkClient: Avoid error launching BizHawkClient via Launcher CLI
What is this fixing or adding?
Today the BizHawk Client calls argparse.ArgumentParser.parse_args with no arguments, so it parses the entirety of sys.argv. If BizHawkClient is invoked via the Launcher's command line (python3 Launcher.py BizHawkClient), this means the user will see an error on launch:
NotImplementedError: No Handler for BizHawkClient found.
If the user tries to pass a patch file (for example python3 Launcher.py BizHawkClient patch.apemerald) it won't start at all, failing to start with
usage: Launcher.py [-h] [--connect CONNECT] [--password PASSWORD] [--nogui] [patch_file]
Launcher.py: error: unrecognized arguments: patch.apemerald
The reason I noticed this I have a shortcut to the .AppImage with BizHawkClient as an argument (since there's no equivalent to ArchipelagoBizHawkClient.exe using the image), and I saw the above NotImplementedError every time I launched. It didn't prevent gameplay (this is not a blocker) but it would be nicer to not have the error.
The fix:
The Launcher already passes the args to the component's registered func; the BizHawkClient's launch and launch_client functions just needed to forward those args along and use those instead of parsing from sys.argv[1:] (the default behavior of parse_args). The Core change in this PR is the modification to launch_subprocess to accept arguments.
How was this tested?
Tested both before and after my change, testing Launcher.py BizHawkClient, Launcher.py patch.emerald, Launcher.py BizHawkClient patch.apemerald, BizHawkClient.py, BizHawkClient.py patch.apemerald, and using the "Open Patch" button in the launcher.