summaryrefslogtreecommitdiffstats
path: root/gamechestcli/__main__.py
diff options
context:
space:
mode:
authorvg <vgm+dev@devys.org>2022-09-19 20:50:15 +0200
committervg <vgm+dev@devys.org>2022-09-19 20:50:15 +0200
commit1e61836d565ee7433894b6fd8444a5bf930891f1 (patch)
treed508bdb050ee90a0b97f72c87e22fb20ea8db4d8 /gamechestcli/__main__.py
parent7b656127e3fc0139f13820ddbffc3840924d7dcb (diff)
downloadgamechest-1e61836d565ee7433894b6fd8444a5bf930891f1.tar.gz
gamechest-1e61836d565ee7433894b6fd8444a5bf930891f1.tar.bz2
gamechest-1e61836d565ee7433894b6fd8444a5bf930891f1.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 8fe912d..22749bd 100755
--- a/gamechestcli/__main__.py
+++ b/gamechestcli/__main__.py
@@ -5,16 +5,21 @@ Manage games. Install, remove, run them.
Usage: gamechest install <GAME_ID>
gamechest remove <GAME_ID>
gamechest run [--profile_id=<PROFILE_ID>] <GAME_ID>
- gamechest set [--profile_id=<PROFILE_ID>] [--remote_basedir=<BASEDIR>] [--gamesaves_path]
+ gamechest set [--profile_id=<PROFILE_ID>] [--remote_basedir=<PATH>] [--gamesaves_path=<PATH>]
+ gamechest list [--installed]
+ gamechest showconfig
'''
import sys
import docopt
+from rich import print
from gamechest.cliactions import install, remove, run
from gamechest.gameconfig import config
+from gamechest.statusdb import StatusDB
+from gamechest.gamedb import GameDB
def main():
@@ -35,9 +40,20 @@ def main():
config.set_profile_id(args['--profile_id'])
if args['--remote_basedir']:
config.set_remote_basedir(args['--remote_basedir'])
- if args['--gamesaves_path']
+ if args['--gamesaves_path']:
config.set_gamesaves_path(args['--gamesaves_path'])
config.save()
+ elif args['list']:
+ status_db = StatusDB()
+ if args['--installed']:
+ print(list(status_db.get_installed()))
+ else:
+ game_db = GameDB()
+ list_installed = list(status_db.get_installed())
+ for game_id in game_db.get_ids():
+ print(game_id, 'installed:', game_id in list_installed)
+ elif args['showconfig']:
+ config.print_config()
if __name__ == "__main__":