qmk_firmware/lib/python/qmk/cli/resolve_alias.py
Joel Challis 0326355edc
Some checks failed
Update API Data / api_data (push) Has been cancelled
CLI CI / test (push) Has been cancelled
Update feature branches after develop merge / feature_branch_update (riot) (push) Has been cancelled
Update feature branches after develop merge / feature_branch_update (xap) (push) Has been cancelled
Lint Format / lint (push) Has been cancelled
Regenerate Files / regen (push) Has been cancelled
Unit Tests / test (push) Has been cancelled
Remove DEFAULT_FOLDER handling (#23281)
2025-06-09 05:08:56 +01:00

17 lines
537 B
Python

from qmk.keyboard import keyboard_folder
from milc import cli
@cli.argument('--allow-unknown', arg_only=True, action='store_true', help="Return original if rule is not a valid keyboard.")
@cli.argument('keyboard', arg_only=True, help='The keyboard\'s name')
@cli.subcommand('Resolve any keyboard_aliases for provided rule')
def resolve_alias(cli):
try:
print(keyboard_folder(cli.args.keyboard))
except ValueError:
if cli.args.allow_unknown:
print(cli.args.keyboard)
else:
raise