#!/usr/bin/python3 import argparse from pathlib import Path def interactive_ui(gamedir=Path.cwd()): raise NotImplementedError("Interactive UI is not implemented") def update_game(gamedir=Path.cwd(), noconfirm=False): print("Checking for current game version...") # Call check_game_version() print("Updating game...") # Call update_game(fromver) raise NotImplementedError("Update game is not implemented") def main(): parser = argparse.ArgumentParser(prog="worthless-launcher", description="A worthless launcher written in Python.") parser.add_argument("-D", "-d", "--dir", action="store", type=Path, default=Path.cwd(), help="Specify the game directory (default current working directory)") parser.add_argument("-I", "-i", "--install", action="store_true", help="Install the game (if not already installed, else do nothing)") parser.add_argument("-U", "-u", "--update", action="store_true", help="Update the game (if not updated)") parser.add_argument("--noconfirm", action="store_true", help="Do not ask any questions. (Ignored in interactive mode)") args = parser.parse_args() print(args) if args.install and args.update: raise ValueError("Cannot specify both --install and --update arguments.") if args.install: raise NotImplementedError("Install game is not implemented") if args.update: update_game(args.dir, args.noconfirm) return interactive_ui(args.dir) if __name__ == "__main__": main()