1
0
Fork 0

qmk find: expand operator support (#24468)

This commit is contained in:
Ryan 2024-11-21 22:57:36 +11:00 committed by GitHub
parent c7a04bd930
commit 65a8a5ff69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 43 additions and 17 deletions

View file

@ -153,20 +153,26 @@ qmk cd
This command allows for searching through keyboard/keymap targets, filtering by specific criteria. `info.json` and `rules.mk` files contribute to the search data, as well as keymap configurations, and the results can be filtered using "dotty" syntax matching the overall `info.json` file format.
For example, one could search for all keyboards using STM32F411:
For example, one could search for all keyboards powered by the STM32F411 microcontroller:
```
qmk find -f 'processor=STM32F411'
qmk find -f 'processor==STM32F411'
```
...and one can further constrain the list to keyboards using STM32F411 as well as rgb_matrix support:
The list can be further constrained by passing additional filter expressions:
```
qmk find -f 'processor=STM32F411' -f 'features.rgb_matrix=true'
qmk find -f 'processor==STM32F411' -f 'features.rgb_matrix==true'
```
The following filter expressions are also supported:
The following filter expressions are supported:
- `key == value`: Match targets where `key` is equal to `value`. May include wildcards such as `*` and `?`.
- `key != value`: Match targets where `key` is not `value`. May include wildcards such as `*` and `?`.
- `key < value`: Match targets where `key` is a number less than `value`.
- `key > value`: Match targets where `key` is a number greater than `value`.
- `key <= value`: Match targets where `key` is a number less than or equal to `value`.
- `key >= value`: Match targets where `key` is a number greater than or equal to `value`.
- `exists(key)`: Match targets where `key` is present.
- `absent(key)`: Match targets where `key` is not present.
- `contains(key, value)`: Match targets where `key` contains `value`. Can be used for strings, arrays and object keys.
@ -175,7 +181,7 @@ The following filter expressions are also supported:
You can also list arbitrary values for each matched target with `--print`:
```
qmk find -f 'processor=STM32F411' -p 'keyboard_name' -p 'features.rgb_matrix'
qmk find -f 'processor==STM32F411' -p 'keyboard_name' -p 'features.rgb_matrix'
```
**Usage**: