2023-08-30 17:00:29 +00:00
|
|
|
import argparse
|
|
|
|
import logging
|
|
|
|
|
|
|
|
from ryujinx_mako import commands
|
2023-09-05 20:19:25 +00:00
|
|
|
from ryujinx_mako._const import SCRIPT_NAME
|
2024-01-27 19:49:49 +00:00
|
|
|
from ryujinx_mako.commands import Subcommand
|
2023-08-30 17:00:29 +00:00
|
|
|
|
|
|
|
parser = argparse.ArgumentParser(
|
|
|
|
prog=SCRIPT_NAME,
|
|
|
|
description="A python module to aid Ryujinx with project management and moderation",
|
|
|
|
)
|
|
|
|
|
|
|
|
subparsers = parser.add_subparsers(
|
|
|
|
title="subcommands",
|
|
|
|
required=True,
|
|
|
|
)
|
|
|
|
subcommands = []
|
|
|
|
|
|
|
|
for subcommand in commands.SUBCOMMANDS:
|
|
|
|
subcommand_parser = subparsers.add_parser(
|
|
|
|
subcommand.name(),
|
|
|
|
description=subcommand.description(),
|
2024-01-27 19:49:49 +00:00
|
|
|
help=subcommand.description(),
|
2023-08-30 17:00:29 +00:00
|
|
|
)
|
2024-01-27 19:49:49 +00:00
|
|
|
Subcommand.add_subcommand(subcommand.name(), subcommand(subcommand_parser))
|
2023-08-30 17:00:29 +00:00
|
|
|
# Keep a reference to the subcommand
|
2024-01-27 19:49:49 +00:00
|
|
|
subcommands.append(Subcommand.get_subcommand(subcommand.name()))
|
2023-08-30 17:00:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
def run():
|
2023-09-05 20:19:25 +00:00
|
|
|
logger = logging.getLogger(SCRIPT_NAME)
|
2023-08-30 17:00:29 +00:00
|
|
|
logger.addHandler(logging.StreamHandler())
|
|
|
|
logger.setLevel(logging.INFO)
|
|
|
|
|
|
|
|
args = parser.parse_args()
|
|
|
|
args.func(args)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
run()
|