ArchipelagoMW / Archipelago

Archipelago Multi-Game Randomizer and Server
https://archipelago.gg
Other
469 stars 624 forks source link

Launcher: explicitly handle cli arguments to be passed to the Component #3714

Closed qwint closed 1 week ago

qwint commented 1 month ago

What is this fixing or adding?

adds handling for the -- cli arg by having launcher capture, ignore, and pass through all of the values after it, while only processing (and validating) the values before it

updates text client and its components to allow for args to be passed through, captured in run_as_textclient, and used in parse_args if present

updates help text (both the usage line if parsing fails and --help text) to explicitly mention the -- arg parsing (see below)

How was this tested?

below errors as well as confirming the following work as expected python Launcher.py "Text Client" -- --connect test@:localhost python CommonClient.py --connect test@:localhost

I think url handling would need to be overhauled, but #2779 is already trying to do that, but currently the following work python Launcher.py -- archipelago://test:@localhost python CommonClient.py archipelago://test:@localhost and opening up archipelago://test:@localhost in browser and letting Archipelago handle the protocol

If this makes graphical changes, please attach screenshots.

python Launcher.py test test image

python Launcher.py "Text Client" --nogui image

python Launcher.py "Text Client" -- test test image

python Launcher.py --help image

python CommonClient.py --help image

python CommonClilent.py test test image

NewSoupVi commented 2 weeks ago

I have two comments I'd like to be answered, otherwise this is more or less approved from my side