File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ func runGenerateCommand(command *cobra.Command, args []string) {
61
61
62
62
logrus .Info ("Executing `arduino-cli keys generate`" )
63
63
64
- _ , err := keys .Generate (context .Background (), & rpc.KeysGenerateRequest {
64
+ resp , err := keys .Generate (context .Background (), & rpc.KeysGenerateRequest {
65
65
AlgorithmType : algorithmType ,
66
66
KeyName : keyName ,
67
67
KeysKeychain : keysKeychain ,
@@ -70,6 +70,19 @@ func runGenerateCommand(command *cobra.Command, args []string) {
70
70
feedback .Errorf (tr ("Error during Generate: %v" ), err )
71
71
os .Exit (errorcodes .ErrGeneric )
72
72
}
73
+ feedback .PrintResult (result {resp })
74
+ }
75
+
76
+ // output from this command requires special formatting, let's create a dedicated
77
+ // feedback.Result implementation
78
+ type result struct {
79
+ Keychain * rpc.KeysGenerateResponse `json:"keys_keychain"`
80
+ }
81
+
82
+ func (dr result ) Data () interface {} {
83
+ return dr .Keychain
84
+ }
73
85
74
- feedback .Print (tr ("Keys created in: %s" , keysKeychain ))
86
+ func (dr result ) String () string {
87
+ return (tr ("Keys created in: %s" , dr .Keychain .KeysKeychain ))
75
88
}
You can’t perform that action at this time.
0 commit comments