-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tools: use a YAML-compatible format by default
Let's output something that is both human- and machine-readable. This makes it easier to search for specific devices with YAML parsers, e.g. to select all bluetooth devices one could use: $ libwacom-list-devices | yq '.devices[] | select(.bus == "bluetooth") | .name' Output for list-devices is now: devices: - { bus: 'i2c', vid: '0x056a', pid: '0x5169', name: 'Wacom ISDv4 5169' } ... Output for list-local-devices is now for example: devices: - name: 'Wacom Intuos Pro M' bus: 'usb' vid: '0x056a' pid: '0x0357' nodes: - /dev/input/event24 - /dev/input/event23 - /dev/input/event22 Output for list-compatible-stylis is now for example: - name: 'ISDv4 0163' styli: - { id: '0x1', name: 'AES Pen' } - { id: '0x11', name: 'AES Pen' } - { id: '0x19', name: 'AES Pen' } Note that as shown above, all hex numbers are encoded as strings. This prevents automatic conversion to decimal when using yq or other yaml formatters since the final result of the processing is almost always for human consumption (and thus needs the hex codes). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
- Loading branch information
Showing
5 changed files
with
73 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters