diff options
author | Nick Brassel <nick@tzarc.org> | 2021-05-10 01:06:44 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-09 17:06:44 +0200 |
commit | 1426ffc0ee64c1d6de072ffc9d7fd9d1291f4f86 (patch) | |
tree | b23c47fd1d2c31b11f48346df090665f4cf2b098 /lib/python/qmk/cli/info.py | |
parent | f544b60aaa60eea3349eb5fbbae8ba3fd3c1b755 (diff) |
Add script to perform parallel builds. (#12497)
Co-authored-by: Erovia <Erovia@users.noreply.github.com>
Diffstat (limited to 'lib/python/qmk/cli/info.py')
-rwxr-xr-x | lib/python/qmk/cli/info.py | 14 |
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) |