From 5a46b5e60463b96663390bb2c6d6f65f4d94b045 Mon Sep 17 00:00:00 2001 From: derrod Date: Mon, 30 Mar 2020 07:09:53 +0200 Subject: [PATCH] Add --dry-run option to just print command line (python3.8+) --- src/rktlnch.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/rktlnch.py b/src/rktlnch.py index 49469da..faf3916 100644 --- a/src/rktlnch.py +++ b/src/rktlnch.py @@ -6,7 +6,7 @@ import json import os import shlex -from sys import exit as _exit +from sys import exit as _exit, version_info from base64 import b64decode, b64encode @@ -34,6 +34,10 @@ def exit(code=0): parser.add_argument('--override-username', dest='user_name_override', action='store', help='Override epic username') + if version_info.minor >= 8: + parser.add_argument('--dry-run', dest='just_print', action='store_true', + default=False, help='Do not launch, just print the command line and exit.') + args, extra = parser.parse_known_args() elfs = EPCLFS() @@ -152,6 +156,10 @@ def exit(code=0): print('Adding extra params:', ', '.join(extra)) params.extend(extra) + if version_info.minor >= 8 and args.just_print: + print('Launch command:', shlex.join(params)) + exit(0) + try: # Launching the game! print('Launching the game... ', end='', flush=True)