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

* 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

* Update worlds/LauncherComponents.py

Co-authored-by: Aaron Wagener <mmmcheese158@gmail.com>

* explicitly using default args for parse_args when launched directly

* revert manual arg parsing by request

* Update CommonClient.py

* Update LauncherComponents.py

* :)

---------

Co-authored-by: Aaron Wagener <mmmcheese158@gmail.com>
Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
This commit is contained in:
qwint
2024-09-08 11:13:01 -05:00
committed by GitHub
parent d90cf0db65
commit 5021997df0
3 changed files with 8 additions and 5 deletions

View File

@@ -61,7 +61,7 @@ class Component:
processes = weakref.WeakSet()
def launch_subprocess(func: Callable, name: str = None, args: Tuple[str, ...] = ()):
def launch_subprocess(func: Callable, name: str = None, args: Tuple[str, ...] = ()) -> None:
global processes
import multiprocessing
process = multiprocessing.Process(target=func, name=name, args=args)
@@ -85,7 +85,7 @@ class SuffixIdentifier:
def launch_textclient(*args):
import CommonClient
launch_subprocess(CommonClient.run_as_textclient, "TextClient", args)
launch_subprocess(CommonClient.run_as_textclient, name="TextClient", args=args)
def _install_apworld(apworld_src: str = "") -> Optional[Tuple[pathlib.Path, pathlib.Path]]: