[cli/core] Add env var for wrapper and fix priority

Priority should always be command line > env var > config
This commit is contained in:
derrod 2020-05-23 18:33:11 +02:00
parent 6c9e3a1d62
commit c52cd09eb7
2 changed files with 2 additions and 1 deletions

View file

@ -839,6 +839,7 @@ def main():
launch_parser.add_argument('--language', dest='language', action='store', metavar='<two letter language code>',
help='Override language for game launch (defaults to system settings)')
launch_parser.add_argument('--wrapper', dest='wrapper', action='store', metavar='<wrapper command>',
default=os.environ.get('LGDRY_WRAPPER', None),
help='Wrapper command to launch game with')
if os.name != 'nt':

View file

@ -253,7 +253,7 @@ class LegendaryCore:
params = []
if wrapper := self.lgd.config.get(app_name, 'wrapper', fallback=wrapper):
if wrapper or (wrapper := self.lgd.config.get(app_name, 'wrapper')):
params.extend(shlex.split(wrapper))
if os.name != 'nt' and not disable_wine: