@cli.argument('-n','--dry-run',arg_only=True,action='store_true',help="Don't write the data to disk.")
@cli.argument('-f','--filter',arg_only=True,action='append',default=[],help="Filter the list of keyboards based on partial name matches the supplied value. May be passed multiple times.")
@cli.subcommand('Creates a new keymap for the keyboard of your choosing',hidden=Falseifcli.config.user.developerelseTrue)
@cli.subcommand('Generate QMK API data',hidden=Falseifcli.config.user.developerelseTrue)
defgenerate_api(cli):
"""Generates the QMK API data.
"""
ifBUILD_API_PATH.exists():
shutil.rmtree(BUILD_API_PATH)
shutil.copytree(TEMPLATE_PATH,BUILD_API_PATH)
v1_dir=BUILD_API_PATH/'v1'
keyboard_all_file=v1_dir/'keyboards.json'# A massive JSON containing everything
keyboard_list_file=v1_dir/'keyboard_list.json'# A simple list of keyboard targets
@ -34,14 +60,14 @@ def generate_api(cli):
keyboard_metadata_file=v1_dir/'keyboard_metadata.json'# All the data configurator/via needs for initialization
usb_file=v1_dir/'usb.json'# A mapping of USB VID/PID -> keyboard target