Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added programmer.default directive to set a default programmer for a board. #2416

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
cmaglie merged 5 commits into arduino:master from cmaglie:default-programmer
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added default programmer in board details CLI command
  • Loading branch information
cmaglie committed Nov 13, 2023
commit 83c87fc07bc5cd154d39e0515df2a6280f3370d5
10 changes: 7 additions & 3 deletions internal/cli/board/details.go
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,11 @@ func (dr detailsResult) String() string {
}
}

green := color.New(color.FgGreen)
tab.AddRow() // get some space from above
for _, option := range details.ConfigOptions {
tab.AddRow(tr("Option:"), option.OptionLabel, "", option.Option)
for _, value := range option.Values {
green := color.New(color.FgGreen)
if value.Selected {
tab.AddRow("",
table.NewCell(value.ValueLabel, green),
Expand All @@ -216,9 +216,13 @@ func (dr detailsResult) String() string {
}
}

tab.AddRow(tr("Programmers:"), tr("ID"), tr("Name"))
tab.AddRow(tr("Programmers:"), tr("ID"), tr("Name"), "")
for _, programmer := range details.Programmers {
tab.AddRow("", programmer.Id, programmer.Name)
if programmer.Id == details.DefaultProgrammerID {
tab.AddRow("", table.NewCell(programmer.Id, green), table.NewCell(programmer.Name, green), table.NewCell("✔ (default)", green))
} else {
tab.AddRow("", programmer.Id, programmer.Name)
}
}

return t.Render() + tab.Render()
Expand Down
2 changes: 2 additions & 0 deletions internal/cli/feedback/result/rpc.go
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ type BoardDetailsResponse struct {
DebuggingSupported bool `json:"debugging_supported,omitempty"`
IdentificationProperties []*BoardIdentificationProperties `json:"identification_properties,omitempty"`
BuildProperties []string `json:"build_properties,omitempty"`
DefaultProgrammerID string `json:"default_programmer_id,omitempty"`
}

func NewBoardDetailsResponse(b *rpc.BoardDetailsResponse) *BoardDetailsResponse {
Expand All @@ -440,6 +441,7 @@ func NewBoardDetailsResponse(b *rpc.BoardDetailsResponse) *BoardDetailsResponse
DebuggingSupported: b.GetDebuggingSupported(),
IdentificationProperties: NewBoardIdentificationProperties(b.GetIdentificationProperties()),
BuildProperties: b.GetBuildProperties(),
DefaultProgrammerID: b.GetDefaultProgrammerId(),
}
}

Expand Down

AltStyle によって変換されたページ (->オリジナル) /