#!/usr/bin/python3 ''' Manage games. Install, remove, run them. Usage: gamechest install gamechest remove 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(): args = docopt.docopt(__doc__) #print(args); raise SystemExit(0) if args['install']: install.install(args['']) elif args['remove']: remove.remove(args['']) 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[''], 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__": main()