aboutsummaryrefslogtreecommitdiff
path: root/lib/python/qmk/cli/resolve_alias.py
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2025-02-28 09:23:04 +1100
committerNick Brassel <nick@tzarc.org>2025-02-28 09:23:04 +1100
commita63fd7f01cdabd9ce85bb09ae2b573fd3b8e60aa (patch)
tree35d817580e5244d62a150a2d012f72906a610977 /lib/python/qmk/cli/resolve_alias.py
parent6d0e5728aa61b442885d48caf49d29e5c60e8197 (diff)
parentcdb865cf60b17593f5c811c24a21d7b3030d8653 (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.py16
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