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

Commit c069ece

Browse files
committed
use same default format as "config dump"
1 parent ba04e61 commit c069ece

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

‎internal/cli/config/get.go‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ package config
1717

1818
import (
1919
"encoding/json"
20-
"fmt"
2120
"os"
2221

2322
"github.com/arduino/arduino-cli/commands/daemon"
@@ -26,6 +25,7 @@ import (
2625
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
2726
"github.com/sirupsen/logrus"
2827
"github.com/spf13/cobra"
28+
"gopkg.in/yaml.v3"
2929
)
3030

3131
func initGetCommand() *cobra.Command {
@@ -77,5 +77,10 @@ func (gr getResult) Data() interface{} {
7777
}
7878

7979
func (gr getResult) String() string {
80-
return fmt.Sprintf("%v", gr.resp)
80+
gs, err := yaml.Marshal(gr.resp)
81+
if err != nil {
82+
// Should never happen
83+
panic(tr("unable to marshal config to YAML: %v", err))
84+
}
85+
return string(gs)
8186
}

0 commit comments

Comments
(0)

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