summaryrefslogtreecommitdiffstats
path: root/lib/python/qmk/cli/info.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python/qmk/cli/info.py')
-rwxr-xr-xlib/python/qmk/cli/info.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/python/qmk/cli/info.py b/lib/python/qmk/cli/info.py
index 6115e8f87d..0d08d242cd 100755
--- a/lib/python/qmk/cli/info.py
+++ b/lib/python/qmk/cli/info.py
@@ -10,7 +10,7 @@ from milc import cli
from qmk.json_encoders import InfoJSONEncoder
from qmk.constants import COL_LETTERS, ROW_LETTERS
from qmk.decorators import automagic_keyboard, automagic_keymap
-from qmk.keyboard import keyboard_completer, keyboard_folder, render_layouts, render_layout
+from qmk.keyboard import keyboard_completer, keyboard_folder, render_layouts, render_layout, rules_mk
from qmk.keymap import locate_keymap
from qmk.info import info_json
from qmk.path import is_keyboard
@@ -124,12 +124,20 @@ def print_text_output(kb_info_json):
show_keymap(kb_info_json, False)
+def print_parsed_rules_mk(keyboard_name):
+ rules = rules_mk(keyboard_name)
+ for k in sorted(rules.keys()):
+ print('%s = %s' % (k, rules[k]))
+ return
+
+
@cli.argument('-kb', '--keyboard', type=keyboard_folder, completer=keyboard_completer, help='Keyboard to show info for.')
@cli.argument('-km', '--keymap', help='Show the layers for a JSON keymap too.')
@cli.argument('-l', '--layouts', action='store_true', help='Render the layouts.')
@cli.argument('-m', '--matrix', action='store_true', help='Render the layouts with matrix information.')
@cli.argument('-f', '--format', default='friendly', arg_only=True, help='Format to display the data in (friendly, text, json) (Default: friendly).')
@cli.argument('--ascii', action='store_true', default=not UNICODE_SUPPORT, help='Render layout box drawings in ASCII only.')
+@cli.argument('-r', '--rules-mk', action='store_true', help='Render the parsed values of the keyboard\'s rules.mk file.')
@cli.subcommand('Keyboard information.')
@automagic_keyboard
@automagic_keymap
@@ -146,6 +154,10 @@ def info(cli):
cli.log.error('Invalid keyboard: "%s"', cli.config.info.keyboard)
return False
+ if bool(cli.args.rules_mk):
+ print_parsed_rules_mk(cli.config.info.keyboard)
+ return False
+
# Build the info.json file
kb_info_json = info_json(cli.config.info.keyboard)