Fix parsing failed due to assumption of a fixed output format of system_profiler SPUSBDataType#23
Open
phuclv90 wants to merge 2 commits intojlhonora:masterfrom
Open
Fix parsing failed due to assumption of a fixed output format of system_profiler SPUSBDataType#23phuclv90 wants to merge 2 commits intojlhonora:masterfrom
system_profiler SPUSBDataType#23phuclv90 wants to merge 2 commits intojlhonora:masterfrom
Conversation
This script assumes that all entries have 6 lines following Product ID which is absolutely not true It also assumes that there are 7 lines after the bus and there are always Location ID or Bus Number
system_profiler SPUSBDataType
This was referenced Jun 12, 2023
|
I have this issue with a device. Would be good to get it merged in. I'm using homebrew to install. This is the default homebrew install's output: I cloned @phuclv90's repo and branch, and tested - this is the output: |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This script assumes that all device entries have 6 lines following
Product IDwhich is absolutely not true. Just with a single line changeyou'll get it mostly work
However it also have many other wrong assumptions like there are 7 lines after the bus name and there are always
Location IDorBus Number. Therefore the tree feature is completely broken. It also prints buses as devices although I don't know why and that makes buses printed twice along with the missing product ID. This can't fix all those issues but will make the tree feature less crippled