Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
mrege modules
  • Loading branch information
Massimiliano Pippi committed Aug 28, 2019
commit c3df6dbfdf7be7ea1316854ea33f32700aacff64
46 changes: 0 additions & 46 deletions cli/output/output.go

This file was deleted.

24 changes: 24 additions & 0 deletions cli/output/rpc_progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,34 @@ package output
import (
"fmt"

"github.com/arduino/arduino-cli/cli/globals"
"github.com/arduino/arduino-cli/commands"
rpc "github.com/arduino/arduino-cli/rpc/commands"
"github.com/cmaglie/pb"
)

// ProgressBar returns a DownloadProgressCB that prints a progress bar.
// If JSON output format has been selected, the callback outputs nothing.
func ProgressBar() commands.DownloadProgressCB {
if globals.OutputFormat != "json" {
return NewDownloadProgressBarCB()
}
return func(curr *rpc.DownloadProgress) {
// XXX: Output progress in JSON?
}
}

// TaskProgress returns a TaskProgressCB that prints the task progress.
// If JSON output format has been selected, the callback outputs nothing.
func TaskProgress() commands.TaskProgressCB {
if globals.OutputFormat != "json" {
return NewTaskProgressCB()
}
return func(curr *rpc.TaskProgress) {
// XXX: Output progress in JSON?
}
}

// NewDownloadProgressBarCB creates a progress bar callback that outputs a progress
// bar on the terminal
func NewDownloadProgressBarCB() func(*rpc.DownloadProgress) {
Expand Down