Skip to content

Commit 2ea2c2a

Browse files
committed
handle Verbose parameters
1 parent 1d2a4b7 commit 2ea2c2a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

programmer.go

+9
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ type boardExtraInfo struct {
4242
WaitForUploadPort bool `json:"wait_for_upload_port"`
4343
Network bool `json:"network"`
4444
Auth basicAuthData `json:"auth"`
45+
Verbose bool `json:"verbose"`
46+
ParamsVerbose string `json:"params_verbose"`
47+
ParamsQuiet string `json:"params_quiet"`
4548
}
4649

4750
// Scp uploads sourceFile to remote machine like native scp console app.
@@ -229,6 +232,12 @@ func spProgramLocal(portname string, boardname string, filePath string, commandl
229232
commandline = strings.Replace(commandline, "{serial.port}", portname, 1)
230233
commandline = strings.Replace(commandline, "{serial.port.file}", filepath.Base(portname), 1)
231234

235+
if extraInfo.Verbose == true {
236+
commandline = strings.Replace(commandline, "{upload.verbose}", extraInfo.ParamsVerbose, 1)
237+
} else {
238+
commandline = strings.Replace(commandline, "{upload.verbose}", extraInfo.ParamsQuiet, 1)
239+
}
240+
232241
// search for runtime variables and replace with values from globalToolsMap
233242
var runtimeRe = regexp.MustCompile("\\{(.*?)\\}")
234243
runtimeVars := runtimeRe.FindAllString(commandline, -1)

0 commit comments

Comments
 (0)