diff --git a/game7ctl/game7ctl/cli.py b/game7ctl/game7ctl/cli.py index 8f4fa5f..8bd76e9 100644 --- a/game7ctl/game7ctl/cli.py +++ b/game7ctl/game7ctl/cli.py @@ -1,10 +1,19 @@ import argparse +from typing import Callable from .core import generate_cli as core_generate_cli from .InventoryFacet import generate_cli as inventory_generate_cli +from .DiamondLoupeFacet import generate_cli as dloupe_generate_cli +from .DiamondCutFacet import generate_cli as dcut_generate_cli +from .OwnershipFacet import generate_cli as own_generate_cli from .version import VERSION +def add_subparser(cmd_name: str, subparser: argparse.ArgumentParser, cli_gen: Callable): + subcommand = cli_gen() + subparser.add_parser(cmd_name, parents=[subcommand], add_help=False) + + def generate_cli() -> argparse.ArgumentParser: """ Generates the argument parsers for the game7ctl command-line tool. @@ -19,11 +28,15 @@ def generate_cli() -> argparse.ArgumentParser: subparsers = parser.add_subparsers() - core_parser = core_generate_cli() - subparsers.add_parser("core", parents=[core_parser], add_help=False) - - inventory_parser = inventory_generate_cli() - subparsers.add_parser("inventory", parents=[inventory_parser], add_help=False) + add_subparser( + "core", + subparsers, + core_generate_cli, + ) + add_subparser("inventory", subparsers, inventory_generate_cli) + add_subparser("diamond-loupe", subparsers, dloupe_generate_cli) + add_subparser("diamond-cut", subparsers, dcut_generate_cli) + add_subparser("ownership", subparsers, own_generate_cli) return parser diff --git a/game7ctl/game7ctl/version.txt b/game7ctl/game7ctl/version.txt index 8acdd82..4e379d2 100644 --- a/game7ctl/game7ctl/version.txt +++ b/game7ctl/game7ctl/version.txt @@ -1 +1 @@ -0.0.1 +0.0.2