Skip to content

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

Merged
merged 3 commits into from
Sep 10, 2019
Merged

Show core name when listing boards #395

merged 3 commits into from
Sep 10, 2019

Conversation

masci
Copy link
Contributor

@masci masci commented Sep 5, 2019

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.

@masci masci requested review from cmaglie and per1234 September 5, 2019 16:30
@masci masci marked this pull request as ready for review September 5, 2019 16:39
@masci masci added component/CLI topic: documentation Related to documentation for the project labels Sep 5, 2019
@masci masci added this to the 0.6.0 milestone Sep 5, 2019
@masci masci changed the title Show core when listing boards Show core name when listing boards Sep 5, 2019
Copy link
Contributor

@rsora rsora left a 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

Copy link
Member

@cmaglie cmaglie left a 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 👍

@@ -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, ":")]
Copy link
Member

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.

@masci masci merged commit cc5e3d6 into master Sep 10, 2019
@masci masci deleted the massi/show-core branch September 10, 2019 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: documentation Related to documentation for the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Please specify instructions better
4 participants