diff options
| author | Nick Brassel | 2025-02-27 23:23:04 +0100 |
|---|---|---|
| committer | Nick Brassel | 2025-02-27 23:23:04 +0100 |
| commit | a63fd7f01cdabd9ce85bb09ae2b573fd3b8e60aa (patch) | |
| tree | 35d817580e5244d62a150a2d012f72906a610977 /lib/python/qmk/cli/resolve_alias.py | |
| parent | 6d0e5728aa61b442885d48caf49d29e5c60e8197 (diff) | |
| parent | cdb865cf60b17593f5c811c24a21d7b3030d8653 (diff) | |
Merge remote-tracking branch 'upstream/develop'
Diffstat (limited to 'lib/python/qmk/cli/resolve_alias.py')
| -rw-r--r-- | lib/python/qmk/cli/resolve_alias.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/python/qmk/cli/resolve_alias.py b/lib/python/qmk/cli/resolve_alias.py new file mode 100644 index 0000000000..b9ffb46618 --- /dev/null +++ b/lib/python/qmk/cli/resolve_alias.py @@ -0,0 +1,16 @@ +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 DEFAULT_FOLDER and 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 |