Skip to content

Commit 2d5f68a

Browse files
committed
output: Added some helpers and missing license
1 parent 3b877f8 commit 2d5f68a

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

cli/output.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
//
2+
// This file is part of arduino-cli.
3+
//
4+
// Copyright 2018 ARDUINO SA (http://www.arduino.cc/)
5+
//
6+
// This software is released under the GNU General Public License version 3,
7+
// which covers the main part of arduino-cli.
8+
// The terms of this license can be found at:
9+
// https://www.gnu.org/licenses/gpl-3.0.en.html
10+
//
11+
// You can be released from the requirements of the above licenses by purchasing
12+
// a commercial license. Buying such a license is mandatory if you want to modify or
13+
// otherwise use the software for commercial activities involving the Arduino
14+
// software without disclosing the source code of your own applications. To purchase
15+
// a commercial license, send an email to [email protected].
16+
//
217

318
package cli
419

output/rpc_progress.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ package output
2020
import (
2121
"fmt"
2222

23-
"github.com/arduino/arduino-cli/commands"
2423
"github.com/arduino/arduino-cli/rpc"
2524
pb "gopkg.in/cheggaaa/pb.v1"
2625
)
@@ -51,9 +50,14 @@ func NewDownloadProgressBarCB() func(*rpc.DownloadProgress) {
5150
}
5251
}
5352

53+
// NewNullDownloadProgressCB returns a progress bar callback that outputs nothing.
54+
func NewNullDownloadProgressCB() func(*rpc.DownloadProgress) {
55+
return func(*rpc.DownloadProgress) {}
56+
}
57+
5458
// NewTaskProgressCB returns a commands.TaskProgressCB progress listener
5559
// that outputs to terminal
56-
func NewTaskProgressCB() commands.TaskProgressCB {
60+
func NewTaskProgressCB() func(curr *rpc.TaskProgress) {
5761
var name string
5862
return func(curr *rpc.TaskProgress) {
5963
// fmt.Printf(">>> %v\n", curr)
@@ -74,3 +78,8 @@ func NewTaskProgressCB() commands.TaskProgressCB {
7478
}
7579
}
7680
}
81+
82+
// NewNullTaskProgressCB returns a progress bar callback that outputs nothing.
83+
func NewNullTaskProgressCB() func(curr *rpc.TaskProgress) {
84+
return func(curr *rpc.TaskProgress) {}
85+
}

0 commit comments

Comments
 (0)