1
0
Fork 0

[Refactor] qmk find (#21096)

This commit is contained in:
Pablo Martínez 2024-02-17 13:28:40 +01:00 committed by GitHub
parent e2dbe39b94
commit 6810aaf013
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 89 additions and 24 deletions

View file

@ -1,7 +1,7 @@
"""Command to search through all keyboards and keymaps for a given search criteria.
"""
from milc import cli
from qmk.search import search_keymap_targets
from qmk.search import filter_help, search_keymap_targets
@cli.argument(
@ -11,7 +11,7 @@ from qmk.search import search_keymap_targets
action='append',
default=[],
help= # noqa: `format-python` and `pytest` don't agree here.
"Filter the list of keyboards based on their info.json data. Accepts the formats key=value, function(key), or function(key,value), eg. 'features.rgblight=true'. Valid functions are 'absent', 'contains', 'exists' and 'length'. 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.
f"Filter the list of keyboards based on their info.json data. Accepts the formats key=value, function(key), or function(key,value), eg. 'features.rgblight=true'. Valid functions are {filter_help()}. 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.
)
@cli.argument('-p', '--print', arg_only=True, action='append', default=[], help="For each matched target, print the value of the supplied info.json key. May be passed multiple times.")
@cli.argument('-km', '--keymap', type=str, default='default', help="The keymap name to build. Default is 'default'.")