summaryrefslogtreecommitdiffstats
path: root/gamechestcli/__main__.py
diff options
context:
space:
mode:
authorvg <vgm+dev@devys.org>2022-09-19 18:30:16 +0200
committervg <vgm+dev@devys.org>2022-09-19 18:30:16 +0200
commit7b656127e3fc0139f13820ddbffc3840924d7dcb (patch)
treeb73074e268d130013257b8c35ef6e0e16ca5ee3a /gamechestcli/__main__.py
parent21908c97c1e897554751070d08e2b35694529bc0 (diff)
downloadgamechest-7b656127e3fc0139f13820ddbffc3840924d7dcb.tar.gz
gamechest-7b656127e3fc0139f13820ddbffc3840924d7dcb.tar.bz2
gamechest-7b656127e3fc0139f13820ddbffc3840924d7dcb.zip
git-sync on seele
Diffstat (limited to 'gamechestcli/__main__.py')
-rwxr-xr-xgamechestcli/__main__.py20
1 files changed, 18 insertions, 2 deletions
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 <GAME_ID>
gamechest remove <GAME_ID>
- gamechest run --profile_id=<PROFILE_ID> <GAME_ID>
+ gamechest run [--profile_id=<PROFILE_ID>] <GAME_ID>
+ gamechest set [--profile_id=<PROFILE_ID>] [--remote_basedir=<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['<GAME_ID>'])
elif args['run']:
- run.run(args['<GAME_ID>'], 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['<GAME_ID>'], 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__":