diff --git a/CommonClient.py b/CommonClient.py index 7f91172a..122de476 100644 --- a/CommonClient.py +++ b/CommonClient.py @@ -1035,7 +1035,7 @@ def run_as_textclient(*args): parser = get_base_parser(description="Gameless Archipelago Client, for text interfacing.") parser.add_argument('--name', default=None, help="Slot Name to connect as.") parser.add_argument("url", nargs="?", help="Archipelago connection url") - args = parser.parse_args(args if args else None) # this is necessary as long as CommonClient itself is launchable + args = parser.parse_args(args) if args.url: url = urllib.parse.urlparse(args.url) @@ -1053,4 +1053,4 @@ def run_as_textclient(*args): if __name__ == '__main__': logging.getLogger().setLevel(logging.INFO) # force log-level to work around log level resetting to WARNING - run_as_textclient() + run_as_textclient(*sys.argv[1:]) # default value for parse_args diff --git a/Launcher.py b/Launcher.py index 97903e2a..42f93547 100644 --- a/Launcher.py +++ b/Launcher.py @@ -401,7 +401,10 @@ if __name__ == '__main__': init_logging('Launcher') Utils.freeze_support() multiprocessing.set_start_method("spawn") # if launched process uses kivy, fork won't work - parser = argparse.ArgumentParser(description='Archipelago Launcher') + parser = argparse.ArgumentParser( + description='Archipelago Launcher', + usage="[-h] [--update_settings] [Patch|Game|Component] [-- component args here]" + ) run_group = parser.add_argument_group("Run") run_group.add_argument("--update_settings", action="store_true", help="Update host.yaml and exit.") diff --git a/worlds/LauncherComponents.py b/worlds/LauncherComponents.py index 4c64642a..fe6e44bb 100644 --- a/worlds/LauncherComponents.py +++ b/worlds/LauncherComponents.py @@ -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]]: