diff --git a/qmk_cli/script_qmk.py b/qmk_cli/script_qmk.py index fe37674..7a685e6 100644 --- a/qmk_cli/script_qmk.py +++ b/qmk_cli/script_qmk.py @@ -66,9 +66,15 @@ def parse_args(): def main(): + """Dispatch the CLI subcommand to the proper place. + + We first check to see if the subcommand was provided by the global `qmk`. If it was we import that module and hand control over to the entrypoint. + + All other subcommands are dispatched to the local `qmk`, either the one we are currently in or whatever the user's default qmk_firmware is. + """ subcommand, subcommand_args = parse_args() subcommand_module = 'qmk_cli.' + subcommand - sys.argv = ['qmk-'+subcommand] + subcommand_args[1:] + sys.argv = ['qmk-'+subcommand] + subcommand_args qmk_firmware = find_qmk_firmware() qmk_bin = qmk_firmware / 'bin' / 'qmk' os.environ['QMK_HOME'] = str(qmk_firmware)