summaryrefslogtreecommitdiffstats
path: root/gamechestcli/src/__main__.py
diff options
context:
space:
mode:
authorvg <vgm+dev@devys.org>2026-02-04 17:05:41 +0100
committervg <vgm+dev@devys.org>2026-02-04 17:05:41 +0100
commit39fbe96daacf1ed2971ce9acb439d2ff0cc7eedb (patch)
tree6aefb6e96e77bfb8b9d2057f302a2d8099a72d89 /gamechestcli/src/__main__.py
parentebb5a47b3108d05c6f54bf67a335b10078aeabc0 (diff)
downloadgamechest-39fbe96daacf1ed2971ce9acb439d2ff0cc7eedb.tar.gz
gamechest-39fbe96daacf1ed2971ce9acb439d2ff0cc7eedb.tar.bz2
gamechest-39fbe96daacf1ed2971ce9acb439d2ff0cc7eedb.zip
git-sync on dita
Diffstat (limited to 'gamechestcli/src/__main__.py')
-rwxr-xr-xgamechestcli/src/__main__.py67
1 files changed, 0 insertions, 67 deletions
diff --git a/gamechestcli/src/__main__.py b/gamechestcli/src/__main__.py
deleted file mode 100755
index 8452b99..0000000
--- a/gamechestcli/src/__main__.py
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/python3
-'''
-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=<PATH>] [--gamesaves_path=<PATH>]
- gamechest list [--installed|--not-installed]
- gamechest showconfig
-
-Options:
- --profile_id=<PROFILE_ID>, -p <PROFILE_ID>
- use profile <PROFILE_ID> instead of the default one.
-'''
-
-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():
- args = docopt.docopt(__doc__)
- #print(args); raise SystemExit(0)
-
- if args['install']:
- install.install(args['<GAME_ID>'])
- elif args['remove']:
- remove.remove(args['<GAME_ID>'])
- elif args['run']:
- 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()
- 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():
- if args['--not-installed']:
- if game_id not in list_installed:
- print(game_id)
- else:
- print(game_id, 'installed:', game_id in list_installed)
- elif args['showconfig']:
- config.print_config()
-
-
-if __name__ == "__main__":
- main()