8000 add "config get" command to print settings values by ardnew · Pull Request #2307 · arduino/arduino-cli · GitHub
[go: up one dir, main page]

Skip to content

add 8000 "config get" command to print settings values #2307

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 10 commits into from
Feb 14, 2024
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Cristian Maglie <c.maglie@bug.st>
  • Loading branch information
ardnew and cmaglie committed Feb 8, 2024
commit ba04e6101c9bde93845695da990694b8eef170b4
5 changes: 3 additions & 2 deletions internal/cli/config/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,13 @@ func runGetCommand(cmd *cobra.Command, args []string) {
for _, toGet := range args {
resp, err := svc.SettingsGetValue(cmd.Context(), &rpc.SettingsGetValueRequest{Key: toGet})
if err != nil {
feedback.Fatal(tr("Cannot get the key %[1]s: %[2]v", toGet, err), feedback.ErrGeneric)
feedback.Fatal(tr("Cannot get the configuration key %[1]s: %[2]v", toGet, err), feedback.ErrGeneric)
}
var result getResult
err = json.Unmarshal([]byte(resp.GetJsonData()), &result.resp)
if err != nil {
feedback.Fatal(tr("Cannot parse JSON for key %[1]s: %[2]v", toGet, err), feedback.ErrGeneric)
// Should never happen...
panic(fmt.Sprintf("Cannot parse JSON for key %[1]s: %[2]v", toGet, err))
}
feedback.PrintResult(result)
}
Expand Down
0