Skip to content
This repository has been archived by the owner on Dec 2, 2021. It is now read-only.

Commit

Permalink
Add --dry-run option to just print command line (python3.8+)
Browse files Browse the repository at this point in the history
  • Loading branch information
derrod committed Mar 30, 2020
1 parent e5d4523 commit 5a46b5e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/rktlnch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5a46b5e

Please sign in to comment.