Skip to content

Commit 8d57a7d

Browse files
cli: board search
1 parent 0e12e46 commit 8d57a7d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

internal/cli/board/search.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,26 +67,26 @@ func runSearchCommand(cmd *cobra.Command, args []string) {
6767
// output from this command requires special formatting so we create a dedicated
6868
// feedback.Result implementation
6969
type searchResults struct {
70-
boards []*fResult.BoardListItem
70+
Boards []*fResult.BoardListItem `json:"boards"`
7171
}
7272

7373
func (r searchResults) Data() interface{} {
74-
return r.boards
74+
return r
7575
}
7676

7777
func (r searchResults) String() string {
78-
if len(r.boards) == 0 {
78+
if len(r.Boards) == 0 {
7979
return ""
8080
}
8181

8282
t := table.New()
8383
t.SetHeader(tr("Board Name"), tr("FQBN"), tr("Platform ID"), "")
8484

85-
sort.Slice(r.boards, func(i, j int) bool {
86-
return r.boards[i].Name < r.boards[j].Name
85+
sort.Slice(r.Boards, func(i, j int) bool {
86+
return r.Boards[i].Name < r.Boards[j].Name
8787
})
8888

89-
for _, item := range r.boards {
89+
for _, item := range r.Boards {
9090
hidden := ""
9191
if item.IsHidden {
9292
hidden = tr("(hidden)")

0 commit comments

Comments
 (0)