From 7b656127e3fc0139f13820ddbffc3840924d7dcb Mon Sep 17 00:00:00 2001 From: vg Date: Mon, 19 Sep 2022 18:30:16 +0200 Subject: git-sync on seele --- gamechestcli/__main__.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'gamechestcli/__main__.py') diff --git a/gamechestcli/__main__.py b/gamechestcli/__main__.py index 1497e40..8fe912d 100755 --- a/gamechestcli/__main__.py +++ b/gamechestcli/__main__.py @@ -4,12 +4,17 @@ Manage games. Install, remove, run them. Usage: gamechest install gamechest remove - gamechest run --profile_id= + gamechest run [--profile_id=] + gamechest set [--profile_id=] [--remote_basedir=] [--gamesaves_path] + ''' +import sys + import docopt from gamechest.cliactions import install, remove, run +from gamechest.gameconfig import config def main(): @@ -21,7 +26,18 @@ def main(): elif args['remove']: remove.remove(args['']) elif args['run']: - run.run(args[''], args['--profile_id']) + profile_id = args['--profile_id'] or config.get_profile_id() + if not profile_id: + print('profile_id must be not null', file=sys.stderr) + run.run(args[''], profile_id) + elif args['set']: + if args['--profile_id']: + config.set_profile_id(args['--profile_id']) + if args['--remote_basedir']: + config.set_remote_basedir(args['--remote_basedir']) + if args['--gamesaves_path'] + config.set_gamesaves_path(args['--gamesaves_path']) + config.save() if __name__ == "__main__": -- cgit v1.2.3