-
-
Notifications
You must be signed in to change notification settings - Fork 398
Show core name when listing boards #395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent!
Ok for not providing the core name as a JSON output field, the aim in this case is to improve the UX
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a small nitpick, for the rest 👍
cli/board/list.go
Outdated
@@ -100,15 +101,17 @@ func outputListResp(ports []*rpc.DetectedPort) { | |||
for _, b := range boards { | |||
board := b.GetName() | |||
fqbn := b.GetFQBN() | |||
t.AddRow(address, protocol, board, fqbn) | |||
core := fqbn[:strings.LastIndex(fqbn, ":")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have some infra for FQBN parsing here https://github.com/arduino/arduino-cli/blob/master/arduino/cores/fqbn.go#L36 that would be nice using here.
Fixes #191
Now that #336 has been released, the vicious cycle of not knowing the board name if the corresponding core is not available, and not knowing which core to install without the board name, is finally broken.
To help users who are not familiar with the FQBN concept to better understand which core has to be installed, a new column in the output of
board list
was added to show the name of the core that supports the detected board.The README was updated accordingly.
Note: the core name wasn't added to the JSON output because that would require a non trivial amount of code - provided that the JSON output is supposed to be read by a machine and provided that the name of the core can be easily deduced from the data the CLI already provides, my advice is to avoid making the code too complex and let client applications do a little extra work when needed.