diff options
author | QMK Bot <[email protected]> | 2023-03-16 20:36:32 +0000 |
---|---|---|
committer | QMK Bot <[email protected]> | 2023-03-16 20:36:32 +0000 |
commit | 79ae14ae0accfdb7496821ed61adbcd4c99fe28a (patch) | |
tree | 603b6d539b565205d569abf40118e3f339dc4c3f /lib/python/qmk/cli/find.py | |
parent | 23313c59763a65042f711606a67ae9262cb584ca (diff) | |
parent | 1b3f7fcf7d3d441623e065c0be7821c5c5d87c75 (diff) | |
download | qmk_firmware-79ae14ae0accfdb7496821ed61adbcd4c99fe28a.tar.gz qmk_firmware-79ae14ae0accfdb7496821ed61adbcd4c99fe28a.zip |
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'lib/python/qmk/cli/find.py')
-rw-r--r-- | lib/python/qmk/cli/find.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/python/qmk/cli/find.py b/lib/python/qmk/cli/find.py new file mode 100644 index 0000000000..b6f74380ab --- /dev/null +++ b/lib/python/qmk/cli/find.py @@ -0,0 +1,23 @@ +"""Command to search through all keyboards and keymaps for a given search criteria. +""" +from milc import cli +from qmk.search import search_keymap_targets + + + '-f', + '--filter', + arg_only=True, + action='append', + default=[], + help= # noqa: `format-python` and `pytest` don't agree here. + "Filter the list of keyboards based on the supplied value in rules.mk. Matches info.json structure, and accepts the formats 'features.rgblight=true' or 'exists(matrix_pins.direct)'. May be passed multiple times, all filters need to match. Value may include wildcards such as '*' and '?'." # noqa: `format-python` and `pytest` don't agree here. +) [email protected]('-km', '--keymap', type=str, default='default', help="The keymap name to build. Default is 'default'.") [email protected]('Find builds which match supplied search criteria.') +def find(cli): + """Search through all keyboards and keymaps for a given search criteria. + """ + targets = search_keymap_targets(cli.args.keymap, cli.args.filter) + for target in targets: + print(f'{target[0]}:{target[1]}') |